Re: Hat bug report: Ambiguous occurrence `List'
Malcolm Wallace <[email protected]> Tue, 29 Jun 2004 10:55:34 +0100
| Newsgroups | gmane.comp.lang.haskell.hat |
|---|---|
| Organization | Dept of Computer Science, University of York |
| Message-ID | <[email protected]> |
Fergus Henderson <[email protected]> writes: > I tried uncommenting those, and got an error about "fromRational" being > undeclared. I then tried adding "import Prelude(fromRational)" to > src/hatlib/Data/Word.hs, but that didn't work. I ran into the following > problem: Actually, the 'fromRational' that is needed is not the Prelude function of the same name. The following wrapper: foreign import haskell "Prelude.toRational" toRatWord8 :: Word8 -> Rational is the culprit. hat-trans interprets Rational to be a primitive type, and expects primitively-defined tracing operations that lift a real Rational into a traced Rational and drop it again. (cf. the similar operations toWord8 and fromWord8 defined in Hat.Data.WordBuiltin) Unfortunately, these lifting and dropping operations are automatically given the names 'fromRational' and 'toRational' respectively, which not only clash with the Prelude names, but have completely different types. > | /home/fjh007/hat/cvs/hat/script/hat-trans -P. -I. -trusted -prelude > | -D__GLASGOW_HASKELL__=620 Data/Word.hs > | > | Fail: AuxLabelAST.letVar: == not let-bound in env Oops. That's rather nasty. > The build continued a little longer, But should not have done. For some reason, hat-trans is exiting with a successful status even in the presence of an error. Regards, Malcolm