
I'm rewriting some old code,originally written for ghc-4.08.2 .
1)Now, when I compile with ghc-5.02 , fails:
ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c foo.hs
foo.hs:47: failed to load interface for `PrelAddr': Could not find interface file for `PrelAddr' gmake: *** [foo.o] Error 1
2)if commented, --import PerlAddr
ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c foo.hs
foo.hs:112: Type constructor or class not in scope: `Addr'
foo.hs:514: Data constructor not in scope: `A#'
gmake: *** [foo.o] Error 1
3)In doc available I'm recommended to import Foreign
import Foreign
ghc -cpp -fglasgow-exts -O -fvia-C -syslib lang -syslib concurrent -c foo.hs
foo.hs:511: Data constructor not in scope: `A#'
gmake: *** [foo.o] Error 1
The Addr type is now deprecated, and has been replaced by the Ptr type. The 'A#' constructor belonged to the Addr type - the code shouldn't have been using the internal representation. I suggest you change it to use published interfaces instead because it will end up being more portable to future versions of GHC. Also, the -syslib option will be removed at some point; nowadays -package is the right option to use. Cheers, Simon