Consider the type of keys:
keys :: TypeRepMap f -> [SomeTypeRep]
this looks fine until you consider the kinds:
keys :: forall k (f :: k -> Type). TypeRepMap f -> [SomeTypeRep]
the value of k is erased! We can try to get it back by patching on SomeTypeRep and getting rep :: TypeRep (a' :: k') and typeRepKind rep:: TypeRep k', then we could try to testEquality, but that requires an extra Typeable constraint on the k, which isn't actually anywhere to be found if say the map is empty.
Consider the type of
keys:this looks fine until you consider the kinds:
the value of
kis erased! We can try to get it back by patching onSomeTypeRepand gettingrep :: TypeRep (a' :: k')andtypeRepKind rep:: TypeRep k', then we could try totestEquality, but that requires an extra Typeable constraint on the k, which isn't actually anywhere to be found if say the map is empty.