New ticket 1274 -- Add a MonadState instance for the Parsec monad

Isaac Dupree isaacdupree at charter.net
Fri Apr 13 17:39:30 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maxime Henrion wrote:
> I just submitted a ticket (#1274) to add a MonadState instance for the
> GenParser monad of Parsec.  As said in the ticket, the only drawback I
> see to this is the added dependency on mtl.  I don't believe this is a
> real issue though.  Of course, comments are welcome.

Control.Monad.State.Class
non-portable (multi-param classes, functional dependencies)
class (Monad m) => MonadState s m | m -> s
<http://darcs.haskell.org/packages/mtl/Control/Monad/State/Class.hs>

According to
<http://hackage.haskell.org/trac/haskell-prime/wiki/HaskellExtensions>,
only GHC and Hugs supports fundeps presently, and there would be no
avoiding this extension if the instance were put in the module where
GenParser is defined. -whereas Parsec has been careful to keep its
non-Haskell98 components in separate modules that don't need to be
imported: "If you use the ParsecToken or ParsecPerm modules, you need to
enable the forall extension."
<http://www.cs.uu.nl/~daan/download/parsec/parsec.html>

Is this a correct interpretation, that this would prevent using Parsec
with other compilers (e.g. nhc98)?

Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGH/iSHgcxvIWYTTURAi5kAJ91LZoGRxEqW3vkiNpyJSB1a/OajgCcD+4m
gpzr2HQ+8uUKUEq3vAgJgG4=
=cRoJ
-----END PGP SIGNATURE-----


More information about the Libraries mailing list