haskellari / some

Existential type.
BSD 3-Clause "New" or "Revised" License
36 stars 13 forks source link

GEq (Product f g) instance requires more than needed. #55

Open phadej opened 2 years ago

phadej commented 2 years ago

Consider

data Tag a where
  TagInt :: Tag Int
  TagBool :: Tag Bool

then we can implement a function of type

geqEx :: Product Tag [] a -> Product Tag b -> Maybe (a :~: b)

working as geq. But that Product doesn't have GEq instance.

We can either document this, or remove the instance for the same reason as there isn't TestEquality (Product f g) as in "we don't want to chose which way to bias the instance.