[Haskell-cafe] Portability of Safe Haskell packages
amit at amitlevy.com
Tue Nov 27 18:34:31 CET 2012
FWIW, some very core libraries do this:
(see very top of linked source file)
Perhaps a more general solution would be for GHC to take the internet
file to get compatibility :)
On 11/23/2012 03:34 PM, Roman Cheplyaka wrote:
> * Herbert Valerio Riedel <hvr at gnu.org> [2012-11-24 00:06:44+0100]
>> Roman Cheplyaka <roma at ro-che.info> writes:
>>> It has been pointed out before that in order for Safe Haskell to be
>>> useful, libraries (especially core libraries) should be annotated
>>> properly with Safe Haskell LANGUAGE pragmas.
>>> However, that would make these libraries unusable with alternative
>>> Haskell implementations, even if otherwise they these libraries are
>>> To quote the standard:
>>> If a Haskell implementation does not recognize or support a particular
>>> language feature that a source file requests (or cannot support the
>>> combination of language features requested), any attempt to compile or
>>> otherwise use that file with that Haskell implementation must fail
>>> with an error.
>>> Should it be advised to surround safe annotations with CPP #ifs?
>>> Or does anyone see a better way out of this contradiction?
>> ...but IIRC CPP isn't part of Haskell2010, or is it?
> It isn't indeed. But:
> 1) it's a very basic extension which is supported by (almost?) all
> existing implementations; or
> 2) if you want to be 100% Haskell2010, you can name your file *.cpphs and
> let Cabal do preprocessing.
> 1) is a compromise and 2) is not very practical, so I'm eager to hear
> other alternatives.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe