[Haskell-cafe] Re: ANNOUNCE: haskell-src-exts 0.4.4

Niklas Broberg niklas.broberg at gmail.com
Sun Dec 7 16:28:47 EST 2008


> The full list of pragmas supported by 0.4.4 is: SOURCE, RULES,
> DEPRECATED, WARNING, INLINE, NOINLINE, SPECIALISE, CORE, SCC,
> GENERATED and UNPACK.

The newly released version 0.4.4.1 adds to the list of pragmas
supported by adding support for the following: LANGUAGE, OPTIONS,
OPTIONS_{GHC, HUGS, NHC98, YHC, HADDOCK, your tool here}, INCLUDE and
CFILES. The LANGUAGE pragma is checked for well-formedness (a
comma-separated list of constructors) but no validation of the
constructors is done. The other pragmas all have their contents
unchecked and passed along as is.

Apart from this, HSE now also parses any unrecognized pragma in option
(e.g. LANGUAGE), declaration (e.g. RULES) or expression (e.g. SCC)
position, allowing user-customized pragmas. Unrecognized pragmas in
other positions will (unfortunately) give a parse error. If this ever
means a problem for you - let me know!

The only pragmas supported by GHC that HSE supports are, to my
knowledge, ANN and LINE. I may add support for these in a near future,
though I believe the syntax for the ANN pragma is still a bit in flux.
Note that source files containing these pragmas can still be parsed by
HSE, just like any other unrecognized pragmas in proper positions.

> 0.4.4 is backwards incompatible with 0.4.3 for two constructors:
> * The Module constructor (:: Module) now has an extra argument of type
> 'Maybe WarningText', used for deprecated modules.
> * The ImportDecl constructor (:: ImportDecl) now has an extra argument
> of type Bool, stating whether the SOURCE pragma has been used for the
> import.

0.4.4.1 is backwards incompatible with 0.4.4 by adding yet another
argument to the Module constructor (:: Module) of type [OptionPragma],
used to list the pragmas preceding the beginning of the module proper.

Cheers and happy haskelling,

/Niklas


More information about the Haskell-Cafe mailing list