Version 1 (modified by goldfire, 5 years ago) (diff)


Template Haskell changes to support overlapping type family instances

The current form of a type family instance in Template Haskell is this constructor of the Dec type:

TySynInstD Name [Type] Type

Here is the proposed new constructor:

TySynInstD Name [TySynEqn]


data TySynEqn = TySynEqn [Type] Type

represents one equation with a list of left-hand side patterns and a single right-hand side result. The only alternate design on the table is to use a list of ([Type], Type) pairs instead of an extra datatype.