proposed change to transformers package

I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package: Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl. Darcs repositories: http://code.haskell.org/~ross/transformers/ http://code.haskell.org/~ross/monads-fd/ Docs: http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/ http://code.haskell.org/~ross/monads-fd/dist/doc/html/monads-fd/

On Tue, 23 Mar 2010 14:37:54 +0000, Ross Paterson
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
+1 I support this simple and great proposal. -- Nicolas Pouillard http://nicolaspouillard.fr

On Tue, Mar 23, 2010 at 02:37:54PM +0000, Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
Here's a list of the packages that will be broken by this change because they import the renamed modules, depend on transformers with an open constraint and do not depend on monads-fd or monads-tf: attempt-0.0.2 complexity-0.1.3 control-monad-attempt-0.0.1 control-monad-free-0.5 iteratee-parsec-0.0.2 monad-coroutine-0.5 monad-parallel-0.5 monad-stlike-io-0.2.1 MonadCatchIO-transformers-0.1.0.0 safe-failure-0.2 scc-0.5 Many more packages depending on transformers will need to be updated eventually, but they have bounded dependencies.

Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
I thought the plan was to replace mtl with transformers. If that was the plan wouldn't it be better to actually kill off mtl so it doesn't hang around for years to come? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On Thu, Mar 25, 2010 at 08:13:37AM +1100, Erik de Castro Lopo wrote:
Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
I thought the plan was to replace mtl with transformers.
If that was the plan wouldn't it be better to actually kill off mtl so it doesn't hang around for years to come?
The aim is still to split the concrete monad transformers from the multi-parameter classes with functional dependencies. Last year we proposed replacing mtl with two packages representing the split (transformers and monads-fd) in a big bang, but there was concern about the degree of change. This proposal allows transformers to co-exist with mtl, but also makes monads-fd (depending on transformers) closer to being a plugin replacement for mtl (but still not completely one). I hope to propose such a replacement in the future.

+1
I think this is a great idea.
On Tue, Mar 23, 2010 at 10:37 AM, Ross Paterson
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl. Darcs repositories:
http://code.haskell.org/~ross/transformers/ http://code.haskell.org/~ross/monads-fd/
Docs:
http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/ http://code.haskell.org/~ross/monads-fd/dist/doc/html/monads-fd/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1
This will finally allow me to just load modules importing transformers
into ghci without using "-hide-all-packages -package transformers
-package ..." or without using the package imports extension.
Just for the interested, here are all the reverse dependencies on transformers:
http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/transfo...
(Note that you can sort the columns by clicking on the column headers)
BTW is there a plan and roadmap documented somewhere on the future of mtl?
Bas
On Tue, Mar 23, 2010 at 3:37 PM, Ross Paterson
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl. Darcs repositories:
http://code.haskell.org/~ross/transformers/ http://code.haskell.org/~ross/monads-fd/
Docs:
http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/ http://code.haskell.org/~ross/monads-fd/dist/doc/html/monads-fd/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Thu, Mar 25, 2010 at 11:04 AM, Ross Paterson
On Thu, Mar 25, 2010 at 10:46:25AM +0100, Bas van Dijk wrote:
BTW is there a plan and roadmap documented somewhere on the future of mtl?
No, but my plan is to allow transformers to spread and later propose the revised monads-fd as version 2.0 of mtl.
Maybe we can push the spreading of transformers a bit by putting the following note in the mtl description: "We advise you to use the transformers package if you only need to use the concrete monad transformers (types) and don't need to use the monad transformer classes." ...or something similar. And releasing this as mtl-1.1.0.3. regards, Bas

On Thu, Mar 25, 2010 at 12:13:01PM +0100, Bas van Dijk wrote:
Maybe we can push the spreading of transformers a bit by putting the following note in the mtl description:
"We advise you to use the transformers package if you only need to use the concrete monad transformers (types) and don't need to use the monad transformer classes."
...or something similar. And releasing this as mtl-1.1.0.3.
Looks unlikely while mtl is in the Haskell Platform and transformers isn't. But it seems to be spreading nicely without semi-official support.

Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
I assume that Data.Functor.Identity would still export a Monad instance of Identity? Or would that be moved to monad-fd?
Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl. Darcs repositories:
http://code.haskell.org/~ross/transformers/ http://code.haskell.org/~ross/monads-fd/
Docs:
http://code.haskell.org/~ross/transformers/dist/doc/html/transformers/ http://code.haskell.org/~ross/monads-fd/dist/doc/html/monads-fd/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- Mario Blazevic mblazevic@stilo.com Stilo International This message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, copying, or distribution is strictly prohibited. If you are not the intended recipient(s) please contact the sender by reply email and destroy all copies of the original message and any attachments.

On Thu, Mar 25, 2010 at 08:58:05AM -0400, Mario Blažević wrote:
Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
I assume that Data.Functor.Identity would still export a Monad instance of Identity? Or would that be moved to monad-fd?
Yes, the instance will stay with the data definition in Data.Functor.Identity, and the whole module will be re-exported by Control.Monad.Identity in monads-fd.

Ross Paterson wrote:
On Thu, Mar 25, 2010 at 08:58:05AM -0400, Mario Blažević wrote:
Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class I assume that Data.Functor.Identity would still export a Monad instance of Identity? Or would that be moved to monad-fd?
Yes, the instance will stay with the data definition in Data.Functor.Identity, and the whole module will be re-exported by Control.Monad.Identity in monads-fd.
+1 in that case

Ross Paterson schrieb:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
+1

On Tue, Mar 23, 2010 at 02:37:54PM +0000, Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl.
Now done. I also added Data.Functor.{Constant,Compose} to transformers.

On Fri, 26 Mar 2010 12:15:24 +0000, Ross Paterson
On Tue, Mar 23, 2010 at 02:37:54PM +0000, Ross Paterson wrote:
I propose to rename some of the modules in the transformers package so that it no longer conflicts with the mtl package:
Control.Monad.Identity renamed as Data.Functor.Identity Control.Monad.Trans split between Control.Monad.Trans.Class and Control.IO.Trans.Class
Then Control.Monad.Identity and Control.Monad.Trans are added to monads-fd making it closer to mtl.
Now done. I also added Data.Functor.{Constant,Compose} to transformers.
Nice, thanks! Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- Nicolas Pouillard http://nicolaspouillard.fr

On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
Do you mean data Product f g a = Product (f a) (g a) with Functor, Foldable, Traversable and Applicative instances? Not sure if the other two count as transformers.

Ross Paterson wrote:
On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
Do you mean
data Product f g a = Product (f a) (g a)
with Functor, Foldable, Traversable and Applicative instances? Not sure if the other two count as transformers.
Why wouldn't data Coproduct f g a = FLeft (f a) | FRight (g a) with appropriate instances count as a transformer? -- Live well, ~wren

On Fri, 26 Mar 2010 19:28:18 +0000, Ross Paterson
On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
Do you mean
data Product f g a = Product (f a) (g a)
Yes, I was thinking of using :*: instead of Product: data (:*:) f g a = (:*:) (f a) (g a)
with Functor, Foldable, Traversable and Applicative instances?
Yes.
Not sure if the other two count as transformers.
Why not: data (:+:) f g a = Inl (f a) | Inr (g a) And sure, no applicative nor monad instance for this one. And Fix like in category-extras: http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/... Best regards, -- Nicolas Pouillard http://nicolaspouillard.fr

While I personally prefer the (:*:) and (:+:) notation, both require an additional extension, TypeOperators, and to Ross's point (:+:) fails to be an Applicative/Monad transformers, so the scope of the package starts to stretch there. That said, there are always ideal monad coproducts, but then you need the notion of ideal monads. ;) data Ideal m a = Return a | Ideal (m a) data Mutual m n a = Mutual (m (Mutual n m a)) data (m :+: n) a = Coproduct { runCoproduct :: Either (m a) (n a) } type IdealCoproduct m n = Ideal (Mutual m n :+: Mutual n m) given a definition for class MonadIdeal m where idealize :: m (Ideal m a) -> m a which describes a monad, that has a separate return. You can define instance MonadIdeal m => Monad (Ideal m) and then you can define an 'ideal monad coproduct' of any two ideal monads from there. This covers, Maybe, Either, Identity, and a bunch of others. wherever the 'Return' constructor can be cleanly separated from the rest of the monad. However, this drifts out of library/platform territory and into esoterica. -Edward Kmett On Mon, Mar 29, 2010 at 5:42 AM, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
On Fri, 26 Mar 2010 19:28:18 +0000, Ross Paterson
wrote: On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
Do you mean
data Product f g a = Product (f a) (g a)
Yes, I was thinking of using :*: instead of Product:
data (:*:) f g a = (:*:) (f a) (g a)
with Functor, Foldable, Traversable and Applicative instances?
Yes.
Not sure if the other two count as transformers.
Why not:
data (:+:) f g a = Inl (f a) | Inr (g a)
And sure, no applicative nor monad instance for this one.
And Fix like in category-extras:
http://hackage.haskell.org/packages/archive/category-extras/0.53.5/doc/html/...
Best regards,
-- Nicolas Pouillard http://nicolaspouillard.fr _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Ross Paterson wrote:
On Fri, Mar 26, 2010 at 05:24:18AM -0700, Nicolas Pouillard wrote:
Could we have functors products, sums, fixpoints as well? It would really avoid to redefine them each time.
Do you mean
data Product f g a = Product (f a) (g a)
with Functor, Foldable, Traversable and Applicative instances? Not sure if the other two count as transformers.
I'd expect the appropriate functor product rather be something like data NestedProduct f g a = NestedProduct (f (g a)) IMO, all these functor combinators should be provided somewhere for the sake of standardization, and the transfomers package is not a bad place for them. They are quite useful for building new tranformers, even if they're not transformers themselves.
participants (8)
-
Bas van Dijk
-
Edward Kmett
-
Erik de Castro Lopo
-
Henning Thielemann
-
Mario Blažević
-
Nicolas Pouillard
-
Ross Paterson
-
wren ng thornton