In the book Real World OCaml, the authors put why OCaml uses let rec
for defining recursive functions.
OCaml distinguishes between nonrecurs
I think this has nothing to do with being purely functional, it is just a design decision that in Haskell you are not allowed to do
let a = 0;;
let a = a + 1;;
whereas you can do it in Caml.
In Haskell this code won't work because let a = a + 1
is interpreted as a recursive definition and will not terminate.
In Haskell you don't have to specify that a definition is recursive simply because you can't create a non-recursive one (so the keyword rec
is everywhere but is not written).