Interface Files _ HOWTO?
Fri, 20 Oct 2000 18:09:04 +0200 (MET DST)
After working a lot with Hugs I tried to compile my Haskell code with GHC.
But it does not work, I am not able to figure out how to work with the
interface files (.hi). My program is build out of several modules, like
this (much simpler, but facing the same problem...)
module MyList(MkList(Empty, (:-))) where
infixr 5 :-
data MkList a = Empty
| a :- (MkList a) deriving (Eq, Show)
module ListFun(mapL) where
mapL f Empty = Empty
mapL f (x:-xs) = f x :- mapL f xs
module ListLib(module MyList, module ListFun) where
module Main(main) where
main = putStr (show (mapL (+1) (1:-2:-Empty)))
As I said the code works with hugs, and I want to have the hierarchy in
the library structure.
So, how do I compile this in GHC? I hoped, that it would be enough to
compile all files with the -c option (generating .hi and .o files) and
then compiling Main.hs to get an executable program. Howeve, I get the
> ghc Main.hs
ghc: module version unchanged at 7
Undefined first referenced
symbol in file
ld: fatal: Symbol referencing errors. No output written to a.out
So, what's wrong, and am I totally on the wrong track... (I studied the
GHC User Guide, but could not find the answer to my problem).
Thanks in advance!