Liberalising IncoherentInstances
AntC
anthony_clayden at clear.net.nz
Mon Jul 29 08:35:25 CEST 2013
> AntC <anthony_clayden <at> clear.net.nz> writes:
Uh-oh, quoted the wrong example. I mean:
Starting with:
class C a b | a -> b where foo :: a -> b
instance C [a] [a] where foo = id
t11 = \x -> foo [x] -- t11 :: t -> [t]
I then added:
instance C [Char] [Char] where foo = id
-- more specific!
t12 = \x -> [x] -- t12 :: C [t] [t] => t -> [t]
-- more polymorphic!
More information about the Glasgow-haskell-users
mailing list