In the general case, instances of a class of several types for the same type are impossible. However, if the type is defined in another package or in an old version of the same package, ghc will consider it a different type. Thus, theoretically, one could foo-1.1 define Foo and instances for it, and foo-1.2 define Foo and instances for it and use them together.
However, in practice this will not work. Functions will work with only one type or another. When you write a function that works with Foo , it will only work with one specific Foo , not both of them. Essentially, you have two completely different, irrefutable types. It would be inconvenient to use, completely separate from how inconvenient to build.
source share