let twoToFive = [2;3;4;5]
let oneToFive = 1 :: twoToFive
let zeroToFive = [0;1] @ twoToFive
List.sum ( List.map square [1..100] )
let sumOfSquaresTo100piped =
[1..100] |> List.map square |> List.sum
let sumOfSquaresTo100withFun =
[1..100] |> List.map (fun x->x*x) |> List.sum
| "a" -> printfn "x is a"
| "b" -> printfn "x is b"
| _ -> printfn "x is something else"
let validValue = Some(99)
let optionPatternMatch input =
| Some i -> printfn "input is an int=%d" i
| None -> printfn "input is missing"
optionPatternMatch validValue
optionPatternMatch invalidValue
let threeTuple = "a",2,true
type Person = {First:string; Last:string}
let person1 = {First="john"; Last="Doe"}
| Manager of Employee list
let jdoe = {First="John";Last="Doe"}
printfn "Printing an int %i, a float %f, a bool %b" 1 2.0 true
printfn "A string %s, and something generic %A" "hello" [1;2;3;4]
printfn "twoTuple=%A,\nPerson=%A,\nTemp=%A,\nEmployee=%A"
twoTuple person1 temp worker