I was recently surprised to find that the following three signatures are all valid:
isEqual :: forall a. Eq a => a -> a -> Boolean
isEqual x y = x == y
isEqual' :: forall a. a -> Eq a => a -> Boolean
isEqual' x y = x == y
isEqual'' :: forall a. a -> a -> Eq a => Boolean
isEqual'' x y = x == y
I couldn’t find any documentation about this behavior and I was wondering if anyone could explain it to me. I see that psci seems to retain the original signatures:
> :t isEqual
forall (a :: Type). Eq a => a -> a -> Boolean
> :t isEqual'
forall (a :: Type). a -> (Eq a => a -> Boolean)
> :t isEqual''
forall (a :: Type). a -> a -> (Eq a => Boolean)
Is this some sort of feature or just a grammar quirk? Thanks!