Re:Haskell IO for Imperative Programmers
by ramchip on Monday November 09, 2009 @06:15AM
(#930726)
Monads can be useful as an abstraction; it's more than just a somewhat convoluted way to do I/O. Look at a parser written with Parsec, or the JIT code generation that Harpy offers with monads and combinators. It's very concise and readable. I also think a major strong point of Haskell that you omitted is the type system. I've never had so few runtime errors. Which might not be saying much, since I usually program in C++ ;) but after, I admit it, a fair time spent fighting with the compiler, my experience is that when I finally get it to compile the code is correct. The purity also allows for some clever optimizations; with native code generation, Haskell is very fast. Especially if you include the JVM start time, it feels much snappier than Clojure/Java.
[ Parent
| on HN ]
Here's an example of a parser I wrote using Parsec: http://github.com/michaelmelanson/cminus-compiler/blob/maste...