
1 May
2015
1 May
'15
3:32 p.m.
This question probably asked already. I have a type data T m b a = T (m (b, a)) and it should be instance of `Bifunctor` and `MonadTrans` same time. But there is a problem: instance Bifunctor (T m) is ok, but instance MonadTrans (T ... is not, because first argument is `m` but we need `b`. Type can be rewritten like data T b m a = T (m (b, a)) and instance of MonadTrans is ok: instance MonadTrans (T b) but how to define Bifunctor? instance Bifunctor (T ... I did not found how to workaround this. Is there any type magic for such cases?