[Haskell-cafe] Portability of Safe Haskell packages

Bas van Dijk v.dijk.bas at gmail.com
Fri Nov 23 20:27:25 CET 2012


On 23 November 2012 15:47, Roman Cheplyaka <roma at ro-che.info> wrote:
> Should it be advised to surround safe annotations with CPP #ifs?
> Or does anyone see a better way out of this contradiction?

I think that would be good advice. Note that even if you're only using
GHC then you still want to use CPP in order to support older GHC
versions which don't support Safe Haskell as in:

http://hackage.haskell.org/packages/archive/usb/1.1.0.4/doc/html/src/System-USB-Internal.html

Arguably, in that example it would be better to move the check for the
availability of Safe Haskell to the cabal file which would define a
CPP pragma SAFE_HASKELL which can be used in source files.

Bas



More information about the Haskell-Cafe mailing list