News for hackers. Stuff that matters.
Re:Functional Programming in OCaml by nv-vn on Saturday March 02, 2019 @09:00PM (#19292281)
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.

Re:Functional Programming in OCaml by moocowtruck on Saturday March 02, 2019 @10:09PM (#19292457)
haskell is great at being imperative too look at chris done's work on xml parsing haskell and c; nice example
Re:Functional Programming in OCaml by robert_tweed on Sunday March 03, 2019 @07:43AM (#19294186)
I'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

I would be interested in an analysis of this code from anyone who actually does know Haskell in case I'm misreading it.