unison icon indicating copy to clipboard operation
unison copied to clipboard

Forall types in a record don't work the same as non-records.

Open ChrisPenner opened this issue 1 year ago • 1 comments

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)

ChrisPenner avatar Sep 27 '24 20:09 ChrisPenner