3 ms·
One common critique is that in the toplevel (REPL) you must terminate your inputs by ;; and sometimes you will see code that puts ;; between function definition
by tom_mellior 8y ago
One common critique is that in the toplevel (REPL) you must terminate your inputs by ;; and sometimes you will see code that puts ;; between function definitions too.
Also, nesting pattern matches is a bit ugly:
match x with
| Foo y ->
match y with
| Yes -> ok ()
| No -> not_ok ()
| Bar z -> whatever()
does not work, it must be:
match x with
| Foo y ->
begin match y with
| Yes -> ok ()
| No -> not_ok ()
end
| Bar z -> whatever()
which is not a big deal but surprisingly easy to forget.
Some people would also really like to write
let x = foo
let y = bar
x + y
but it has to be
let x = foo in
let y = bar in
x + y
and those many "in"s accumulate.
A bunch of these things look a lot cleaner in Haskell. Although it does it by being indentation-sensitive, which other people love hating.
- jhwoodyatt 8y agoNobody really cares about programming language syntax as long as the grammar is reasonably sane and the semantics are clear. Which is the case with OCaml. The other criticisms are the ones worth attending.
- int_19h 8y agoWell, enough people cared about the syntax to make Reason...