DoesntWork.hs:56:13: Could not deduce (ex ~ x) from the context (Category w, Prelude.Monad m) bound by the instance declaration at DoesntWork.hs:52:10-61 `ex' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 `x' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 Expected type: WriterT w m e x b Actual type: WriterT w m e ex a In the expression: WriterT \$ do { ~(a, w) <- runWriterT m; ~(b, w') <- runWriterT (k a); return (b, w >>> w') } In an equation for `>>=': m >>= k = WriterT \$ do { ~(a, w) <- runWriterT m; ~(b, w') <- runWriterT (k a); return (b, w >>> w') } where >>= = (Prelude.>>=) return = Prelude.return DoesntWork.hs:56:13: Could not deduce (a ~ b) from the context (Category w, Prelude.Monad m) bound by the instance declaration at DoesntWork.hs:52:10-61 `a' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 `b' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 Expected type: WriterT w m e x b Actual type: WriterT w m e ex a In the expression: WriterT \$ do { ~(a, w) <- runWriterT m; ~(b, w') <- runWriterT (k a); return (b, w >>> w') } In an equation for `>>=': m >>= k = WriterT \$ do { ~(a, w) <- runWriterT m; ~(b, w') <- runWriterT (k a); return (b, w >>> w') } where >>= = (Prelude.>>=) return = Prelude.return DoesntWork.hs:58:29: Could not deduce (e ~ x) from the context (Category w, Prelude.Monad m) bound by the instance declaration at DoesntWork.hs:52:10-61 `e' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 `x' is a rigid type variable bound by the type signature for >>= :: WriterT w m e ex a -> (a -> WriterT w m ex x b) -> WriterT w m e x b at DoesntWork.hs:56:3 Expected type: e Actual type: ex Expected type: WriterT w m e ex a Actual type: WriterT w m ex x b In the return type of a call of `k' In the first argument of `runWriterT', namely `(k a)'