
27 Nov
2009
27 Nov
'09
1:53 p.m.
I have a type family and a type class:
type family ErrorAlg (f :: (* -> *) -> * -> *) e ix :: *
class MkErrorAlg f where
mkErrorAlg :: ErrorAlg f e a -> f (K0 a) ix -> Either e a
Instances for these two really go hand in hand, so I thought I would move the type family into the type class.
Perhaps this isn't answering your question, but you can turn the above into an associated type as follows. class MkErrorAlg f where
type ErrorAlg (f :: (* -> *) -> * -> *) :: * -> * -> * mkErrorAlg :: ErrorAlg f e a -> f (K0 a) ix -> Either e a
Regards, Sean