Haskell Extensions in various compilers (Cabal)

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Jul 19 09:03:47 EDT 2004

Isaac Jones <ijones at syntaxpolice.org> writes:

> I've implemented a mapping[1] between compiler extensions and
> command-line flags in Cabal[2] for GHC, NHC98, and Hugs.  Can some
> representatives from each take a look at these and let me know if I'm
> wrong about how any of them work, whether I missed support for any of
> the compilers, or what-have-you?

RankTwoTypes could perhaps be RankNTypes?  How about adding NamedFieldPuns,
a feature of Haskell 1.4 removed in '98, but supported in nhc98 with
the -puns flag?

> - Are the "hood debugging extensions" in NHC and Hugs compatible?
>   Should they be included?

The original HOOD, as supplied with nhc98, is just a library, written
in H'98 + unsafePerformIO.  The Hugs extension "builds in" the library.
I don't think the HOOD functionality in Hugs is accessible by plain
source code, so it doesn't really count as a language extension.

> - Do any of Hugs, GHC, and NHC disallow Long.Hierarchical.Module.Names
>   by default?  Can they all turn them off?

nhc98 always permits Long.Module.Names with no mechanism to turn them off.

  -- |NHC: Return the unsupported extensions, and the flags for the supported
  extensions extensionsToNHCFlag :: [ Extension ] -> ([Extension], [Opt])
  extensionsToNHCFlag l
      = splitEither $ nub $ map extensionToNHCFlag l
        extensionToNHCFlag NoMonomorphismRestriction = Right "" -- not implemented in NHC
        extensionToNHCFlag ForeignFunctionInterface  = Right ""
+       extensionToNHCFlag NamedFieldPuns            = Right "-puns"
+       extensionToNHCFlag ExistentialQuantification = Right ""
-       extensionToNHCFlag HoodDebugging             = Right ""
        extensionToNHCFlag e                         = Left e

More information about the Libraries mailing list