On Fri, Aug 17, 2007 at 04:27:29PM -0400, Thomas Hartman wrote:
> trying to compile regex-tdfa, I ran into another issue. (earlier I had a 
> cabal problem but that's resolved.)
> 
> there's a line that won't compile, neither for ghc 6.6.1 nor 6.7 
> 
> import 
> GHC.Prim(MutableByteArray#,RealWorld,Int#,sizeofMutableByteArray#,unsafeCoerce#)
> 
> so the fresh darcs regex tdfa package won't build.
> 
> This line (line 16 below) causes this error for 
> 
>   ghc -e '' RunMutState.hs
> 
> for both ghc 6.1 and 6.7 

There are at least two things going on here.

1. GHC-specific unboxed identifiers have a # in the name.   I think this
   is a relic from back when the only reasonable way to namespace was to
   modify your compiler to add extra identifier characters, and use them
   in all non-portable identifiers.  In any case, you have to enable the
   -fglasgow-exts option (or -XMagicHash in recent 6.7) to allow imports
   of such identifiers.

2. Explicitly importing GHC.Prim has been discouraged for as long as I
   can remember, and GHC HQ has finally made good on the promise to make
   it impossible.  Code which imports it has a bug already, which can be
   fixed by switching to GHC.Exts.  (Why?  GHC.Prim is wired into the
   compiler, while GHC.Exts is a normal Haskell module, so by using
   GHC.Exts you are insulated from questions of what is primitive and
   what is derived but still unportable.  Yes, this does change.)

Stefan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to