Category Archives: Language

F# language explained

Efficient Sequence Operators: Seq.breakBy

I wanted to create a sequence function which would break a sequence into a number of equally sized chunks (e.g. to create a sequence of 4 byte arrays out of a byte stream to pass it to System.BitConverter). Here is … Continue reading

Posted in Algorithms, Language | 1 Comment

Interactive Session #11: Units of Measure

F# includes a language feature to annotate your code with units of measure like meter, second or kilogram, preferably from the SI system. These units are statically checked during compile time and will not be part of the compiled code. … Continue reading

Posted in Algorithms, Getting Started, Language | 1 Comment

Interactive Session #10: List, Array, Sequence

F# supports three different list-like data structures to store values of the same type: List, Array and Sequence. In this session we want to explore the similarities and differences among these three types. First lets instantiate values of each of … Continue reading

Posted in Getting Started, Language | 1 Comment

Interactive Session #8: Pipeline Operator

The pipeline operator |> is a quite unique feature of F#, it allows to connect functions which take one argument together by passing the result of one function to the next. > let add1 x = x+1.0;; val add1 : … Continue reading

Posted in Algorithms, General, Language | Leave a comment

Operator Overloading

F# allows overloading of common operators to create custom types. Below is the classic example of a complex type with operators for negation, addition and subtraction. type complex(r:float, i:float) =   member this.r = r member this.i = i static … Continue reading

Posted in Language | Leave a comment