Basically, given {-# LANGUAGE PolymorphicKinds, ConstraintKinds, TypeFamilies #-} (and more, if necessary), does the (~) type-level operator work on type-level expressions of kind Constraint? I tried googling the answer, but had no luck.
Basically, given {-# LANGUAGE PolymorphicKinds, ConstraintKinds, TypeFamilies #-} (and more, if necessary), does the
Share
Yes, it is possible. Because types of kind
Constraintare finite sets of atomic type constraints, you can test their equality very easily.The
PolyKindsextension is not necessary, however. Also, there’s very few situations when this kind equality would actually be useful, because I don’t see a practical way of passing polymorphic constraints as the argumentsc1,c2toBla, so the constraint equality would be a tautology in every case (Show ~ Showhere):