RE: GHCI Can't Find Module But GHC Can
ghci test1.hs -i../lib -I../lib SVG-part1.o SVG-part2.o ../lib/*.o -package lang ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.02.3, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package std ... linking ... done. Loading package lang ... linking ... done. Loading object (static) SVG-part1.o ... done. Loading object (static) SVG-part2.o ... done. Loading object (static) ../lib/Haskell2Xml.o ... done. Loading object (static) ../lib/ParseSTLib.o ... done. Loading object (static) ../lib/Pretty.o ... done. Loading object (static) ../lib/Xml2Haskell.o ... done. Loading object (static) ../lib/XmlCombinators.o ... done. Loading object (static) ../lib/XmlHtmlGen.o ... done. Loading object (static) ../lib/XmlHtmlParse.o ... done. Loading object (static) ../lib/XmlLex.o ... done. Loading object (static) ../lib/XmlLib.o ... done. Loading object (static) ../lib/XmlPP.o ... done. Loading object (static) ../lib/XmlParse.o ... done. Loading object (static) ../lib/XmlTypes.o ... done. final link ... done. can't find module `IOMisc' Prelude>
Where is the module IOMisc located? Does it have source or binary files or both? GHC looks for .hi files and .o files, whereas GHCi also looks for .hs files. If you need to use a pre-compiled Haskell file without source, then it needs to be in a package. Cheers, Simon
___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.02.3, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package std ... linking ... done. Loading package lang ... linking ... done. Loading object (static) SVG-part1.o ... done. Loading object (static) SVG-part2.o ... done. ... final link ... done. can't find module `IOMisc' Prelude>
Where is the module IOMisc located? Does it have source or binary files or both?
I think the problem is that GHCi doesn't respect #ifdef conditional compilation. The HaXml package has modules with stuff like #if defined(__HBC__) import IOMisc #endif which seems to confuse the interpreter (but not the compiler). I've also seen reports that recent versions of GHC don't grok lines like #if __GLASGOW_HASKELL__ <= 210 Regards, Malcolm
participants (2)
-
Malcolm Wallace -
Simon Marlow