Proposal: merge either into transformers

Edward Kmett ekmett at gmail.com
Sat Apr 26 01:55:00 UTC 2014


If you let me know when you want to ship it, I can have a version of the
mtl ready to sit on top.

-Edward


On Fri, Apr 25, 2014 at 8:21 PM, Ross Paterson <R.Paterson at city.ac.uk>wrote:

> On Thu, Apr 24, 2014 at 06:14:48PM +0300, Roman Cheplyaka wrote:
> > * Vincent Hanquez <tab at snarc.org> [2014-04-24 15:45:34+0100]
> > > On 2012-12-07 09:44, Roman Cheplyaka wrote:
> > > >I propose to add the sole module of the 'either' package[1],
> > > >Control.Monad.Trans.Either, to the transformers package.
> > > >
> > > >It provides EitherT, a very basic and fundamental data type. The
> > > >difference between EitherT and ErrorT is that the latter has an Error
> > > >constraint, which is used to imlement 'fail'.
> > > >
> > > >Note that 'either' depends on the 'semigroupoids' and 'semigroup'
> > > >packages to provide appropriate instances. The proposal is not to add
> > > >those instances to 'transformers' to avoid additional dependencies.
> The
> > > >instances can then be left in the 'either' package or moved to the
> > > >'semigroupoids' and 'semigroup' packages respectively.
> ('semigroupoids'
> > > >already depends on 'transformers', while 'semigroups' does not).
> > > >
> > > >Compared to the 'either' package, Show, Read, Eq and Ord instances
> will
> > > >be dropped to keep the code Haskell2010 (those instances require
> > > >FlexibleInstances, FlexibleContexts, and UndecidableInstances).
> > > >
> > > >The patch is attached. [*]
> > > >
> > > >[*] against transformers-0.3.0.0, because the darcs version is not
> > > >buildable (Control/Monad/Signatures.hs is not in the repository).
> > > >
> > >
> > > [Sorry to revive this 1 yr 1/2 thread, but I was looking at the reason
> why
> > > we don't have eitherT is a more canonical place like transformers,
> > > and ended up here ...]
> > >
> > > Is there a reason why this thread ran out of steam ? It not totally
> obvious
> > > from the answers what was missing to move forward.
> > > It seems like there's general agreement that EitherT is a good
> addition, did
> > > this proposal got forgotten ? Is there a way to revive this proposal ?
> >
> > IIRC, last time this was brought up, Ross said that he'd take action
> after GHC
> > 7.8 is released. So your reminder is well timed, in fact ;)
>
> Instead of EitherT, the next version will deprecate ErrorT in favour
> of a transformer ExceptT with base monad Except.  The idea is to have
> analogous transformers and monads
>
>         ExceptT : Except : Either
>         WriterT : Writer : (,)
>         ReaderT : Reader : (->)
>
> Other changes are:
>
>         * Added infixr 9 `Compose` to match (.)
>         * Added Eq, Ord, Read and Show instances where possible
>         * Replaced record syntax for newtypes with separate inverse
> functions
>         * Added delimited continuation functions to ContT
>         * Added instance Alternative IO to ErrorT
>
> Pre-release docs are here:
>
>
> http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140425/b59de38b/attachment-0001.html>


More information about the Libraries mailing list