Skip to main content

F#

· One min read

Syntax​

Anonymous functions​

As I like to say: fun is a keyword in F#

-- [[Scott Wlashin]], probably

let succ n = x + 1
let succ' = fun x -> x + 1

Records​

type MyRecord =
{ X: int
Y: int
Z: int }

Active Patterns​

  • basically, dynamic patterns

guards are great for one-off matches. But if there are certain guards that you use over and over, consider using active patterns instead.

-- Scott Wlashin cite:[Wlashin2012a]

References​