
compiler: nhc98-1.18 on Sun sparc machine code-to-compile: the one near the end of this web page: http://cgi.cse.unsw.edu.au/~dons/blog/2006/12/18 [ I cut-and-paste it into a file called cat.hs ] command invoked: nhc98 -o cat cat.hs nhc98 -package base -o cat cat.hs [ both give the same result. ] The last line of total 4 lines of output looks like: Fail: superclassesI InfoUsedClass 52 [(Type class, Text.Printf.PrintfArg, "ftnirP.txeT", 52:11-52:19)] ... Could someone tell me what I should do to fix the problem ? Note: the same code can be compiled with ghc6.8.2 [ but I have to repalce withFile with withFile1 in cat.hs ]. I am using nhc98 so that the binary-code generated can be small. Thanks HP

HP Wei
Fail: superclassesI InfoUsedClass 52 [(Type class, Text.Printf.PrintfArg, "ftnirP.txeT", 52:11-52:19)] ...
nhc98 is confused about whether the classes defined in Test.Printf are necessary or not. There is a workaround: explicit imports. Replace import Text.Printf with import Text.Printf (IsChar(),PrintfArg(),printf) and everything will work OK. Regards, Malcolm
participants (2)
-
HP Wei
-
Malcolm Wallace