wiki:NewAxioms/TemplateHaskell

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 implemented new constructor:

TySynInstD Name TySynEqn

where

data TySynEqn = TySynEqn [Type] Type

represents one equation with a list of left-hand side patterns and a single right-hand side result.

We also add a new declaration form to the Dec type

ClosedTypeFamilyD Name [TyVarBndr] (Maybe Kind) [TySynEqn]

with a straightforward meaning.

Last modified 10 months ago Last modified on Jun 24, 2013 8:54:20 AM