Quick Reference – F# Language Constructs
Primitive Expressions
sin(3.1415) |
Calling a single-parameter function (parentheses optional) |
max 2 4 |
|
fst(2, "two") |
Calling a function that takes parameters as a tuple (4.4.2) |
new System.Random() |
|
rnd.Next() |
|
fun a -> a + 10 |
|
(3, "three") |
|
() |
Tuple with zero members; also called unit value (3.1) |
Some(10) |
Creating a value of a discriminated union (5.3.4) |
rnd :> Object |
Safe type conversion ... |
Get Real-World Functional Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.