On Mon, Apr 26, 2010 at 2:55 PM, Thomas van Noort wrote:
> On 26-4-2010 20:12, Daniel Fischer wrote:
>>
>> Am Montag 26 April 2010 19:52:23 schrieb Thomas van Noort:
>>>
>>> ...
>>
>> Yes, y's type is more general than the type required by f, hence y is an
>> acceptable argument for f - even z ::
On 26-4-2010 20:12, Daniel Fischer wrote:
Am Montag 26 April 2010 19:52:23 schrieb Thomas van Noort:
...
Yes, y's type is more general than the type required by f, hence y is an
acceptable argument for f - even z :: forall a b. a -> b -> Bool is.
That's what I thought. I've just never seen
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.
T
Am Montag 26 April 2010 19:52:23 schrieb Thomas van Noort:
> Hello all,
>
> I'm having difficulties understanding rank-2 polymorphism in combination
> with overloading. Consider the following contrived definition:
>
> f :: (forall a . Eq a => a -> a -> Bool) -> Bool
> f eq = eq True True
>
> Then,
Thomas van Noort wrote:
> Hello all,
>
> I'm having difficulties understanding rank-2 polymorphism in combination
> with overloading. Consider the following contrived definition:
>
> f :: (forall a . Eq a => a -> a -> Bool) -> Bool
> f eq = eq True True
>
> Then, we pass f both an overloaded fun
Hello all,
I'm having difficulties understanding rank-2 polymorphism in combination
with overloading. Consider the following contrived definition:
f :: (forall a . Eq a => a -> a -> Bool) -> Bool
f eq = eq True True
Then, we pass f both an overloaded function and a regular polymorphic
functi