1. The module system. OCaml's module system is a language in and of itself. It not only allows you to define modules that export certain identifiers and types, it also allows you to write functors, which are essentially functions in the module language that can take a module as an argument and produce a new module as a result. This is a great way of reusing code in a project as well as defining external APIs in a general but natural way. OCaml's module system the closest I've seen to realizing the dream of building software by taking some modules from here or there and composing them together.
2. Mutation. Unlike Haskell, OCaml allows mutation. Specifically, OCaml allows value mutation in certain contexts, while both Haskell and OCaml do not allow variable mutation. What this means is that in both languages, if you have an identifier, you cannot change the value that the identifier points to; you can only shadow the identifier with a new binding. But in OCaml, you can declare certain fields of your types to be mutable. You can also wrap values in a "box" which allows you get the same feel that you would out of variable mutation. While in general it's a good idea to limit your use of mutation, sometimes you know it's ok and you just want to do it. OCaml lets you do that, but it requires you to be explicit about it rather than just letting you do it willy-nilly.
3. gdb-able. If you know how to use gdb (and even valgrind I believe), you can use it to debug your OCaml programs. If you try and use these tools with Haskell, you will get nothing but nonsense until you learn how to read the matrix. This fact by itself for some people will make OCaml a candidate for systems programming over Haskell.
4. Subtyping. Certain features of OCaml's type system allow you to do subtyping, complete with type variable annotations to indicate covariance or contravariance. This is a feature that Haskell's type system does not have, so in a sense this is a strength of OCaml. However in my experience, this feature of the type system is hard to use and reason about, and I've seen little (maybe no?) code in the wild that takes advantage of it, with the exception of some simple inference the type system can do in this respect related to polymorphic variants[3].
All that being said, Haskell's still my hobby language of choice. But for building real systems, I'm warming to idea of OCaml as a viable candidate language.
[0]: http://www.cs.brown.edu/research/plt/dl/adsafety/v1/
[1]: https://github.com/seliopou/typo
[2]: https://github.com/frenetic-lang/frenetic
[3]: https://realworldocaml.org/v1/en/html/variants.html#polymorp...
In regards to #2, this sounds like the ST monad, are they comparable at all?
What makes OCaml easier to debug with GDB opposed to haskell specifically? I don't have experience doing either, but that's a curious statement, I would have assumed they were similar (both native code w/ some sort of GC...)
The ST monad lets you transition from regions which allow mutation to pure regions and then back again.
(In case it's unclear, I'm agreeing with tel and rephrasing.)
[0] indexedList :: [a] -> [(Integer,a)] indexedList l = zip [1..] l
[1] http://www.reddit.com/r/haskell/comments/15h6tz/what_isnt_ha...
http://www.haskell.org/pipermail/haskell-cafe/2013-September...
http://stackoverflow.com/questions/2064426/reasoning-about-p...
indexedList = zip [1..]
Love how ML-like languages let you express just the bare essence of an operation.
[0]: http://elm-lang.org
f x y = y
f (raise Done) Ω
Under lazy application semantics this program will never terminate. Under eager application semantics it will.You can have both composable functions and non-wasteful semantics without turning the whole language into a lazy mess.
Note that this approach will also allow you to abstract over different data sources more easily.
Just writing code? I guess I can agree that lazy evaluation makes it easier, but performance still needs to be considered.
Most people also suggest that strict evaluation and impurity are good traits of OCaml. This is more a contested point, however, as lazy evaluation and strict evaluation are more like duals than one being definitely better than the other. Furthermore, unrestricted side effects are a major tradeoff between convenience and safety—it's up to your use case to decide what's best.
Finally, OCaml obviously has an "O"bject system in it. My understanding is that serious OCamlers shy away from it for reasons of complexity and low value. The major stuff is provided by the module system and doesn't have anything particularly "object" about it.
Here's an example: http://llvm.org/docs/tutorial/OCamlLangImpl1.html
That isn't a factor at all in OCaml - in fact the compiler is fairly "dumb".