Why doesn't Control.Monad.Trans.Writer.censor allow to convert the record type?

Signature

censor :: Monad m => (w -> w) -> WriterT w m a -> WriterT w m a

      

But we could easily have a strictly more general

censor :: Functor m => (w -> w') -> WriterT w m a -> WriterT w' m a
censor = mapWriterT . fmap . second

      

Of course it won't work with a chunkmtl

, but is this a good reason? Or could it be performance related?

+3
haskell parametric-polymorphism monad-transformers


source to share


No one has answered this question yet

Check out similar questions:

24
What's special about Monads?
sixteen
What is a clear example of a monad without a monad transformer?
fourteen
Haskell Monad Transformer Stack and Type Signatures
6
Functors and non-inductive types
6
Use a list of monads inside monad transformer type classes?
five
Pre-folding transformers
4
Why doesn't ContT touch the inner monad?
3
State monads: transition from one type of state to another
3
Monad transformers lift
3
Don't recognize the type as a bound monad type inside a transformer stack



All Articles
Loading...
X
Show
Funny
Dev
Pics