Strong, static typing with inference
let add x y = x + y
// Compiler infers: int -> int -> int
let concat a b = a + b
// Compiler infers: string -> string -> string
type Shape =
| Circle of radius:float
| Rectangle of width:float
* height:float
let myCircle = Circle 5.0
let myRect = Rectangle (4.0, 6.0)
type Person = {
Name: string
Age: int
Email: string option
}
let john = {
Name = "John Doe"
Age = 30
Email = Some "john@example.com"
}