[Haskell-cafe] Ocaml for Haskellers tutorial

Stephen Tetley stephen.tetley at gmail.com
Fri Apr 16 07:40:23 EDT 2010


Ocaml's a fine alternative to Haskell, you could be 'forced' to use
say PHP, now that wouldn't be quite so nice...

> For instance, I have heard that Ocaml is only fast when one uses loops
> instead of folds, but I wonder if this is an overstatement.

Maybe this notion is from the standard library not being optimized for
long lists?


There isn't much on performance in the O'Reilly book, but otherwise it
is pretty comprehensive:

I suspect the difference between the ML module system vs. typeclasses
will be as important as lazy vs. strict. As a style point, Ocaml
programmers don't seem too prone to combinator mania - so I think golf
is a bit less popular over there.

One tip - sometimes you might see Ocaml code with the revised syntax
(particularly Gerard Huet's work, which whilst described as 'Pidgin
ML' is a subset of the Caml revised syntax) - this can be translated
automatically to regular syntax with camlp4. Not knowing this tripped
me up for a couple of days at the end of last year.

Best wishes


More information about the Haskell-Cafe mailing list