[Hat] Hat bug report: Ambiguous occurrence `List'

Fergus Henderson fjh007 at galois.com
Tue Jun 29 15:03:12 EDT 2004


On 29-Jun-2004, Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> wrote:
> I wrote:
> 
> > The following wrapper:
> >     foreign import haskell "Prelude.toRational" toRatWord8 :: Word8 -> Rational
> > is the culprit.
> 
> I've now found a reasonable workaround and checked it into CVS.

Thanks!

Now I get quite a way further before running into the next bug.
This one can be reproduced with a simple one-liner, "(>>) = 42":

	bash$ cat Foo.hs
	(>>) = 42

	bash$ hmake -hat Foo
	hat-trans  Foo.hs
	Wrote Hat/Foo.hs
	/usr/bin/haskell-compiler      -c -package hat -o Hat/Foo.o Hat/Foo.hs

	Hat/Foo.hs:10:
	    Ambiguous occurrence `|>>'
	    It could refer to either `Hat.PreludeBasic.|>>', imported from Hat.Prelude at Hat/Foo.hs:8
				  or `Main.|>>', defined at Hat/Foo.hs:12

While cutting this test case down, I also noticed another problem:

	bash$ cat Foo.hs
	import Prelude hiding (Prelude.head)

	fjh$ hmake -hat Foo
	hat-trans  Foo.hs

	Fail: Variable or constructor not in scope: Prelude.head

However, that one has an easy work-around (don't qualify the name in the hiding list).

-- 
Fergus J. Henderson                 |  "I have always known that the pursuit
Galois Connections, Inc.            |  of excellence is a lethal habit"
Phone: +1 503 626 6616              |     -- the last words of T. S. Garp.


More information about the Hat mailing list