5 ms·
> ML-ish languages make it extremely natural to think like this You say that, but actually fmap doesn't exist in OCaml (or I assume any other common MLs). Of c
by sweeneyrod 7y ago
> ML-ish languages make it extremely natural to think like this
You say that, but actually fmap doesn't exist in OCaml (or I assume any other common MLs). Of course you can embed a language and type system within it that does have it (https://blog.janestreet.com/generic-mapping-and-folding-in-ocaml/ https://blog.janestreet.com/generic-mapping-and-folding-in-o...) but that's different.
- giornogiovanna 7y agoUsing List.map and Option.map is more verbose and less general, but it's still most of the way there. OCaml still has currying, algebraic data types, "implicit" returns, tail call optimization, etc., and it encourages recursion instead of loops wherever applicable.