Consider:

> class Thing t where
>   thing :: t
>
> instance Thing Int where
>   thing = 0
>
> instance Thing Char where
>   thing = 'a'

Can someone please explain why

> fst (1,thing)

...gets an 'ambiguous type variable' error, but

> fst (1,undefined)

...doesn't? And is there anything I can change to make the former work
as well? Even modifying fst doesn't work:

> fst' :: Thing b => (a,b) -> a
> fst' (~a,~b) = a

-- 
~ Jared Warren <[EMAIL PROTECTED]>
Computing Science, Queen's University

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to