check if program uses haskell 98 only? Re: [Haskell-cafe] regex package for yhc?

Henning Thielemann lemming at henning-thielemann.de
Thu Dec 6 16:03:07 EST 2007


On Thu, 6 Dec 2007, Thomas Hartman wrote:

> On a related note... is there some easy way to be sure that a program I am
> compiling uses only haskell 98? (Because any pure haskell 98 should always
> compile on yhc... right?)

You can for instance use 'haskell98' as dependent package instead of
'base' in the Cabal description. If you import other modules, I don't know
how to check that these are Haskell 98. I weakly remember corner cases
where GHC accepts more than Haskell 98 in Haskell 98 mode. (At least it
sometimes suggests fixes for errors that are not Haskell 98, e.g.  class
constraints in signatures. :-)

> I compile this with ghc, no options, and iIt doesn't have any {-#-#}
> options, so according to what I understand, it is using pure haskell 98.
> So I might think this was a candidate for using on yhc.

I could not always pass a GHC-certified module to Hugs or even Haddock. I
remember there is some difference with respect to the trailing 'where' in
the 'instance' head, if the instance declaration is empty.  Haddock expect
some spaces in infix operators (I believe ( # ) instead of (#)), which are
not required by Hugs and GHC.


More information about the Haskell-Cafe mailing list