Comment by spider-mario
13 hours ago
`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
No comments yet
Contribute on Hacker News ↗