<br><div class="gmail_quote">On Wed, Mar 7, 2012 at 7:43 PM, Ross Paterson <span dir="ltr"><<a href="mailto:ross@soi.city.ac.uk">ross@soi.city.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Seeking views before a new major release of transformers package.<br>
The docs are here:<br>
<br>
<a href="http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/" target="_blank">http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/</a><br>
<br>
The source is here:<br>
<br>
darcs get <a href="http://code.haskell.org/~ross/transformers" target="_blank">http://code.haskell.org/~ross/transformers</a><br>
<br>
The major changes from version 0.2.2.0 are:<br>
<br>
* Foldable and Traversable instances for transformers that support them.<br>
* extra Monad instances:<br>
<br>
instance (MonadFix m) => MonadFix (MaybeT m)<br>
instance (MonadFix m) => MonadFix (IdentityT m)<br>
instance (Monad f, Monad g) => Monad (Product f g)<br>
instance (MonadPlus f, MonadPlus g) => MonadPlus (Product f g)<br>
instance (MonadFix f, MonadFix g) => MonadFix (Product f g)<br>
<br>
* new functors Backwards and Reverse<br>
* a new Lift transformer, a generalization of Errors<br>
* generalized constructor functions:<br>
<br>
state :: Monad m => (s -> (a, s)) -> StateT s m a<br>
reader :: Monad m => (r -> a) -> ReaderT r m a<br>
writer :: Monad m => (a, w) -> WriterT w m a<br></blockquote><div> </div><div>Hrmm.<div><br></div><div>If the definitions of 'modify' ran through 'state' they could avoid a round trip through the monad.<br>
</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Another issue that has been raised is: should the instance<br>
<br>
instance Monad (ContT r m)<br>
<br>
have a Monad constraint so that it can define fail?</blockquote><div> </div><div>Ick. </div><div><br></div><div>One of the things I liked about the recent change that brought the monad instance for Either into Control.Monad.Instances was that we didn't go out of our way to screw up a perfectly good monad in order to better support fail, and the same argument could be applied to pollute Codensity, which also currently requires nothing of 'm', but which has ContT r m-like uses involving types like Endo. I'm not a fan of 'slippery slope' arguments, but this strikes me as a slippery slope. ;)</div>
<div><div><br>-Edward</div></div></div>