[Haskell-cafe] instance MonadFix GenParser

Luke Palmer lrpalmer at gmail.com
Sun Feb 22 10:11:49 EST 2009


On Sun, Feb 22, 2009 at 3:31 AM, Paul Johnson <paul at cogito.org.uk> wrote:

> >   parseDeclarations :: Parser [Declaration]
> >   parseDeclarations = mdo
> >      decls <- many ParseDeclaration symbols

>      let symbols = makeSymbolTable decls
> >      return decls


Given a MonadFix instance, keep in mind that you should do this only if the
success of the parse does not depend in any way on the symbol table --
otherwise you will be in bottom city.

Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090222/3d390a6c/attachment.htm


More information about the Haskell-Cafe mailing list