News for hackers. Stuff that matters.
Re:Why do some people like difficult programming languages s... by SamReidHughes on Saturday September 22, 2007 @03:36AM (#58290)
Parsec is indeed a pain in the behind -- it could have been written as a monad transformer (with the current version implemented as a transformation of the Identity monad). It takes a bit of work to make a monad transforming version out of the Parsec source code, a bit more if you want to generalize it out to support parsing byte vectors (as opposed to linked lists of characters) or other things, and overall it's just a pain, and you end up with three monad transformers atop one another, if you do it "right." So then you think, "ok, I'll just make a general parsing typeclass so I can newtype derive solid parsing types," and then boilerplate instances begin, and that takes O(n^2) code overall, where n is the number of monad transformer typeclasses you want to have playing nice with each other. And don't get me started on functional dependencies.

There are no comments on this comment yet.