
26 Apr
2010
26 Apr
'10
2:48 p.m.
On 26-4-2010 20:13, Jochem Berndsen wrote:
Thomas van Noort wrote:
...
f requires a function that is able to compute, for two values of type a (which instantiates Eq), a Boolean.
y certainly fulfills that requirement: it does not even require that the values are of a type instantiating Eq.
This is also well-typed and might or might not be enlightening:
z :: forall a. Eq a => a -> a -> Bool z = y
g :: (Bool, Bool) g = (f x, f z) -- note the use of z here instead of y
I find your example of z more intuitive as it is z that does not provide its dictionary to y, but throws it away explicitly. This in contrast to y that is provided a dictionary but throws it away implicitly. Regards, Thomas
Jochem