Forward compatibility (was Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature)

Matthijs Kooijman matthijs at
Tue Jun 23 05:26:01 EDT 2009

Hi Luke,

> > > Simple: the definition of MonadState uses those extensions.
> > [Snip question: Is this extension supported by all compilers]
> You should treat "all compilers" the same way as a universal quantifier in
> mathematics.  It's not just all the compilers you know about, but all
> possible compilers.  In which case the answer to your question is of course
> no.

I think the reasoninging here is the following: If MonadState is part of the
standard library and it needs this extension to work, then all compilers must
support this extension.

I'm not completely sure how "standard" the MonadState class is though. Also,
it might be that there could be implementations of MonadState that do not use
the extension?

If the latter is not the case, so MonadState will always require this
extension, than it seems that using the extension in your code gives you the
same portability as using the MonadState class. Not using the extension to
improve your portability only makes sense if you also stop using the
MonadState class, right?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url :

More information about the Haskell-Cafe mailing list