unison
unison copied to clipboard
Forall types in a record don't work the same as non-records.
I attempted to define:
structural type Functor f =
{map : forall a b. (a -> b) -> f a -> f b }
Which failed with:
I found a value of type: (a1 -> b1) -> 𝕣
where I expected to find: (a -> b) -> f a -> f b
2 | {map : forall a b. (a -> b) -> f a -> f b }
from right here:
2 | {map : forall a b. (a -> b) -> f a -> f b }
Reconfiguring it as not-a-record works:
structural type Functor f =
Functor (forall a b. (a -> b) -> f a -> f b)