3 ms·
F# is ML family (like ocaml) With F# you use tuple a lot so is nicer have ',' as separator for tuple parts. let tuple1 = (1, 3) //tuple (int, int) let tupl
by enricosada 12y ago
F# is ML family (like ocaml)
With F# you use tuple a lot so is nicer have ',' as separator for tuple parts.
let tuple1 = (1, 3) //tuple (int, int)
let tuple2 = 1, 3 //same as before, parens are optional
let list = [ 1; 2; 3 ] //list of int
let array = [| 1; 2; 3; |] //array of int
let listOfTuple1 = [ (0,0); (1,2); (4,5) ] //list of tuple (int, int)
let listOfTuple2 = [ 0,0; 1,2; 4,5 ] //same as before
see https://dotnetfiddle.net/vzeZvJ https://dotnetfiddle.net/vzeZvJ
nice and fast syntax guide http://fsharpforfunandprofit.com/posts/fsharp-in-60-seconds/ http://fsharpforfunandprofit.com/posts/fsharp-in-60-seconds/
- frowaway001 12y agoI think the question is "why has ML such a nice syntax, and OCaml managed to make it worse all across the board"?