class Collection a where
type family Elem a
e :: a
cons :: Elem a -> a -> a
instance Collection [a] where
type instance Elem [a] = a
...
foobar :: Elem a -> a
foobar = undefined
will generate WF_Elem type family with WF_Elem [a] = () constraint instance. foobar will be elaborated to have WF_Elem a constraint.
Adds support for Associated Type Families, e.g,
will generate
WF_Elem
type family withWF_Elem [a] = ()
constraint instance.foobar
will be elaborated to haveWF_Elem a
constraint.