IMO OCaml is mind-bending (e.g. go figure out the 'in' keyword, I still don't understand it), F# is much easier/simpler.
`let <var> = <expr> in <expr>` is an expression. Top-level bindings are just `let <var> = <expr>`. That’s pretty much all there is to it.
let fac = let rec fac' acc = function | 0 -> acc | n -> fac' (n * acc) (n - 1) in fac' 1 let seven = let four = 4 and three = 3 in four + three
Ocaml is just an ML in the traditional sense. It keep scope without curlies. There is really not much else to it.
The 'in' keyword is purely syntax, like semicolons/newlines or braces in your language of choice.
Never used OCaml but it seems like a way to chain together expressions using the same variable name? Seems odd but I could see myself using it
`let <var> = <expr> in <expr>` is an expression. Top-level bindings are just `let <var> = <expr>`. That’s pretty much all there is to it.
https://ideone.com/HpTrI4Ocaml is just an ML in the traditional sense. It keep scope without curlies. There is really not much else to it.
The 'in' keyword is purely syntax, like semicolons/newlines or braces in your language of choice.
Never used OCaml but it seems like a way to chain together expressions using the same variable name? Seems odd but I could see myself using it