Neil Mitchell wrote:
> I'm looking for a type class which checks whether two types are the
> same or not.
This problem is more complex than appears. It has been solved,
however. IncoherentInstances are not required, as IncoherentInstances
are generally unsafe.
For the full discussion of various solutions, please see Section 9 and
Appendix D of the HList paper:
http://homepages.cwi.nl/~ralf/HList/paper.pdf
The HList code is available
http://darcs.haskell.org/HList/
It includes the examples from the paper.