2 ms·
OCaml is more of a multi-paradigm language than Haskell. It's not purely functional, so you can easily fallback into imperative code if you need (you can use mu
by nv-vn 8y ago
OCaml is more of a multi-paradigm language than Haskell. It's not purely functional, so you can easily fallback into imperative code if you need (you can use mutable variables, I/O, mutable arrays, hashmaps, for loops, while loops, etc.). It's also object-oriented (though this feature is not widely used) and has a very powerful module system that few other languages can compare to.
What I like about it from a learning perspective is that it makes a transition into functional programming much simpler than it would be with Haskell, where you have to completely change the way you program from the very beginning.
- moocowtruck 8y agohaskell is great at being imperative too look at chris done's work on xml parsing haskell and c; nice example
- robert_tweed 8y agoI'm not sure why you're being downvoted. I don't know Haskell, but I had a look for the parser you mentioned and it does appear at first glance to use a fairly imperative-looking style, with loops and pointers into mutable data: https://github.com/ocramz/xeno/blob/master/src/Xeno/DOM.hs https://github.com/ocramz/xeno/blob/master/src/Xeno/DOM.hs I would be interested in an analysis of this code from anyone who actually does know Haskell in case I'm misreading it.