On Fri, Oct 9, 2009 at 6:47 PM, staafmeister <g.c.stavenga@uu.nl> wrote:
Daniel Peebles wrote:
I vaguely remember on IRC someone pointing out that the Parsec monad broke one of the laws. I think return _|_ >> x === _|_ which could be causing your problem. I may be wrong though.
Confirmed, working in the parsec monad
Prelude Text.Parsec> runP (do {x <- return undefined; return 10}) () "" "" *** Exception: Prelude.undefined
In the IO Monad Prelude Text.Parsec> do {x <- return undefined; return 10} 10
Should be fixed.
It looks like the problem is a strict field in the definition of GenParser (specifically in Reply). From what I can tell, Parsec 3.0.1 should not have this problem. -- Dave Menendez <dave@zednenem.com> <http://www.eyrie.org/~zednenem/>