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.
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.