
2010/12/5 Tianyi Cui
Why should they? You can compare them in whatever way you like. And there isn't a natural/inherent sense of total order between types.
I cannot compare then the way I'd like. ;) Consider the following: data BiMap a = BiMap { values :: Map Int a ,indices :: Map a Int } It will serve well for Int's, Bool's and Expr's. Then I decided to store typed Expr's, based on GADTs. Those Expr's contains type indices and it would be natural to classify BiMaps by their type indices and look up in there. If I require type indices to be Typeable, all I need is ordering on TypeRep. Also, I prototyped hypergraph library with hyperedges as types with type family as HList of types denoting labels. There I needed ordering on TypeRep too, again, for efficiency reasons.