[Haskell-cafe] Type synonym family inside type class
leather at cs.uu.nl
Fri Nov 27 08:53:34 EST 2009
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe