"http://www.wikibooks.org/" } val homepage : website > homepage.Title val it : string = "Wikibooks" > homepage.Url val it : string = "http://www.wikibooks.org/" Records
ref > x;; (* returns ref instance *) val it : string ref = {contents = "hello";} > !x;; (* returns x.contents *) val it : string = "hello" > x := "world";; (* updates x.contents with a new value *) val it : unit = () > !x;; (* returns x.contents *) val it : string = "world" Mutability
(true, n) when n >= 0 && n <= 100 -> rest(n) | _ -> None let createMsg msg = fun () -> printf "%s" msg; System.Console.ReadLine() bind(createMsg "#1: ", fun x -> bind(createMsg "#2: ", fun y -> bind(createMsg "#3: ", fun z -> Some(x + y + z) ) ) )
(true, n) when n >= 0 && n <= 100 -> rest(n) | _ -> None let createMsg msg = fun () -> printf "%s" msg; System.Console.ReadLine() bind(createMsg "#1: ", fun x -> bind(createMsg "#2: ", fun y -> bind(createMsg "#3: ", fun z -> Some(x + y + z) ) ) )