Could iteratee depend on mtl instead of transformers?

Hi, Iteratee [1] library depends on transformers [2]. The latter exposes `Control.Monad.Trans' module. [1] http://hackage.haskell.org/package/iteratee-0.3.1 [2] http://hackage.haskell.org/package/transformers-0.1.4.0 So does mtl [3] which is also installed on my system. [3] http://hackage.haskell.org/package/mtl-1.1.0.2 As a result, I cannot compile a program using Data.Iteratee, unless one of the packages is hidden. $ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :m + Control.Monad.Trans Could not find module `Control.Monad.Trans': it was found in multiple packages: mtl-1.1.0.2 transformers-0.1.4.0 $ ghci hide transformers-0.1.4.0 Having transformers hidden, I need to copy-paste MonadTrans and MonadIO instances [4] from Data.Iteratee.Base to my code, otherwise I get errors: Prelude> :load "/home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs" [1 of 1] Compiling Codec.Binary.MSCP ( /home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs, interpreted ) /home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs:88:7: Could not deduce (MonadIO (IterateeG [] Word8 m)) from the context (MonadIO m) arising from a use of `liftIO' at /home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs:88:7-12 Possible fix: add (MonadIO (IterateeG [] Word8 m)) to the context of the type signature for `warn' or add an instance declaration for (MonadIO (IterateeG [] Word8 m)) In the first argument of `(.)', namely `liftIO' In the expression: liftIO . hPutStrLn stderr . ("*WARNING* " ++) In the definition of `warn': warn = liftIO . hPutStrLn stderr . ("*WARNING* " ++) Failed, modules loaded: none. [4] http://bit.ly/1TT37E With MonadTrans & MonadIO instances duplicated, I need to use `-fno-warn-orphans' GHC option in order not to see "orphan instance" warnings. Or I can just update iteratee.cabal and make it depend on mtl instead of transformers: --- iteratee.cabal.orig 2009-11-09 20:40:29.000000000 +0200 +++ iteratee.cabal 2009-11-16 18:32:36.637288144 +0200 @@ -59,7 +59,7 @@ containers >= 0.2 && < 0.4, extensible-exceptions >= 0.1 && < 0.2, haskell98 >= 1 && < 2, - transformers >= 0.1.4 && < 0.2 + mtl >= 1.1 && < 1.2 exposed-modules: Data.Iteratee This allows me to remove Monad{Trans,IO} instances from my code and forget about `-fno-warn-orphans' flag. But now my package cannot claim its dependency on iteratee-0.3.1 any more. Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl? * * * I suspect mtl to be more popular... And actual "popularity" can be measured. I'll try to do that using cabal-query [5] tool; it allows to list "reverse dependencies" [6]. [5] http://hackage.haskell.org/package/cabal-query [6] http://hackage.haskell.org/trac/hackage/ticket/576#comment:2 Cheers. -- vvv

Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
I have successful build iteratee by replacing transformers with mtl in the .cabal file.
I suspect mtl to be more popular... And actual "popularity" can be measured.
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See: http://www.haskell.org/pipermail/libraries/2009-March/011415.html http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On Mon, Nov 16, 2009 at 8:42 PM, Erik de Castro Lopo
wrote:
Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
I have successful build iteratee by replacing transformers with mtl in the .cabal file.
I suspect mtl to be more popular... And actual "popularity" can be measured.
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See:
http://www.haskell.org/pipermail/libraries/2009-March/011415.html http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html
Are we? The first thread starts off cheering for monads-fd/tf and transformers, but fizzles out, as people consider the impact of breaking existing software. The other one is a post by Ganesh, which for all I know could be a statement of his personal position and seems less than authoritative as to the direction of the Haskell Platform as a whole. Perhaps I missed the memo, or perhaps I am just unclear as to which antecedent 'we' refers to in your statement. In any event, I don't mean this to sound nearly as confrontational as it probably does, but I didn't get the impression from either the initial thread or its brief resurgence that anything had been decided. -Edward Kmett

Excerpts from Edward Kmett's message of Tue Nov 17 05:03:01 +0100 2009:
On Mon, Nov 16, 2009 at 8:42 PM, Erik de Castro Lopo
wrote:
Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
I have successful build iteratee by replacing transformers with mtl in the .cabal file.
I suspect mtl to be more popular... And actual "popularity" can be measured.
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See:
http://www.haskell.org/pipermail/libraries/2009-March/011415.html http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html
Are we?
Let's make a poll then! transformers+1 -- Nicolas Pouillard http://nicolaspouillard.fr

On Tue, Nov 17, 2009 at 9:19 AM, Nicolas Pouillard
Excerpts from Edward Kmett's message of Tue Nov 17 05:03:01 +0100 2009:
On Mon, Nov 16, 2009 at 8:42 PM, Erik de Castro Lopo
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See:
http://www.haskell.org/pipermail/libraries/2009-March/011415.html http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html
Are we?
Let's make a poll then!
I went back and reread the two linked threads and I'm no wiser as to why we should prefer transformers. I'd like to see an argument describing the benefits of using transformers vs the drawbacks (including how much code would break). -- Johan

Johan Tibell wrote:
I went back and reread the two linked threads and I'm no wiser as to why we should prefer transformers.
The key point of transformers is that mtl is approximately the same as the combination of transformers + monads-fd - where transformers is H98, and monads-fd has the functional dependency based type classes (MonadState etc). So making the split means that only code that actually needs those classes need depend on them. Since the future of fundeps is up in the air, this seems like a better position to be in. It also enables people to use monads-tf (i.e. type family based classes) without using an incompatible set of transformer types (which is what mtl-tf contains).
I'd like to see an argument describing the benefits of using transformers vs the drawbacks (including how much code would break).
Migration would be by releasing mtl-2.0 which re-exports transformers + monads-fd. There are a few changes in transformers compared to mtl which clean up the design but at the cost of breaking backwards compatibility - one prominent example is that Functor instances in the transformer types now depend on Functor instances in the base types, where as mtl has them depending on Monad instances. Another change (which isn't crucial to the migration) is to replace the currently separate State, Reader etc types with type synonyms to StateT Identity, ReaderT Identity etc. http://www.haskell.org/pipermail/libraries/2009-March/011471.html roughly summarises how much of hackage would break as of then (March 09). I haven't had time to rerun the experiment recently, which is one reason I haven't made a formal proposal yet. I also think that I didn't do anything to test packages that follow the PVP and thus wouldn't have picked up the newer mtl due to having an upper bound on their mtl dependency. Of course such well-behaved packages won't break immediately but will need code changes at some point to be brought up to date. None of the compilation problems are hard to fix, as far as I know. Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================

On Tue, 2009-11-17 at 09:11 +0000, Sittampalam, Ganesh wrote:
I'd like to see an argument describing the benefits of using transformers vs the drawbacks (including how much code would break).
Migration would be by releasing mtl-2.0 which re-exports transformers + monads-fd. There are a few changes in transformers compared to mtl which clean up the design but at the cost of breaking backwards compatibility - one prominent example is that Functor instances in the transformer types now depend on Functor instances in the base types, where as mtl has them depending on Monad instances. Another change (which isn't crucial to the migration) is to replace the currently separate State, Reader etc types with type synonyms to StateT Identity, ReaderT Identity etc.
http://www.haskell.org/pipermail/libraries/2009-March/011471.html roughly summarises how much of hackage would break as of then (March 09). I haven't had time to rerun the experiment recently, which is one reason I haven't made a formal proposal yet. I also think that I didn't do anything to test packages that follow the PVP and thus wouldn't have picked up the newer mtl due to having an upper bound on their mtl dependency. Of course such well-behaved packages won't break immediately but will need code changes at some point to be brought up to date.
We can use hackage and the platform to help manage the transition too. So I don't think it's necessary to go for a minimally breaking design. My opinion is you should go for whatever you can all agree is the best design, and then we manage the transition. I suggest that the strategy should be to: * decide what the best "new" monad library should be (consensus between the various monad package authors and other experts) * play with it as much as possible first to work out the kinks * adjust hackage to make old packages not break by using a preference on mtl < 2 * adjust hackage to require new packages use an upper bound on mtl, indicating if they're compatible with mtl-2 or not * release mtl-2 * once the experts are happy with mtl-2, to include it into the next Haskell Platform release and encourage everyone to switch over. For example, the next platform release will use QC2 and that should help resolve the problem we have now where half the packages are still using QC1 (since that was the version that shipped with ghc and the previous HP release). Duncan

On Tue, Nov 17, 2009 at 10:19 AM, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
Excerpts from Edward Kmett's message of Tue Nov 17 05:03:01 +0100 2009:
On Mon, Nov 16, 2009 at 8:42 PM, Erik de Castro Lopo
wrote:
Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
I have successful build iteratee by replacing transformers with mtl in the .cabal file.
I suspect mtl to be more popular... And actual "popularity" can be measured.
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See:
http://www.haskell.org/pipermail/libraries/2009-March/011415.html
http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html
Are we?
Let's make a poll then!
transformers+1
FWIW, +1 transformers. I like being able to swap monads-fd and monads-tf. Michael

-1 in their current form.
I like that transformers is Haskell 98 and presents a common core. I think
that factoring it out is a laudable goal.
However, my very problem is that monads-fd and monads-tf are mutually
incompatible. It fragments the community of monad combinator users even
further.
If monads-fd sat in the existing location of mtl or was exported there by an
mtl compatibility layer and monads-tf used a different namespace then you
would have a clean solution in which both could be used in the same code,
because both could be loaded.
As it is, all that is done is we will go through all the trouble of breaking
a lot of existing code, only to have to make a decision about which half of
the code we broke we want to break again later once the community slides
towards monads-fd or monads-tf or more likely stagnates in indecision
between them.
In the meantime there is no right answer for library authors who want to be
able to support both.
If this is the direction we want to go, I don't see how we could
conscionably make the choice to change without making it so that monads-fd
and monads-tf can both be loaded by the same program, lest we find ourselves
having this very discussion again in 6 months.
-Edward Kmett
On Tue, Nov 17, 2009 at 7:56 AM, Michael Snoyman
On Tue, Nov 17, 2009 at 10:19 AM, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
Excerpts from Edward Kmett's message of Tue Nov 17 05:03:01 +0100 2009:
On Mon, Nov 16, 2009 at 8:42 PM, Erik de Castro Lopo
wrote:
Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
I have successful build iteratee by replacing transformers with mtl in the .cabal file.
I suspect mtl to be more popular... And actual "popularity" can be measured.
Popularity is not the issue. The issue is that we are currently in a transition from using mtl to using transformers. See:
http://www.haskell.org/pipermail/libraries/2009-March/011415.html
http://www.haskell.org/pipermail/haskell-cafe/2009-October/067744.html
Are we?
Let's make a poll then!
transformers+1
FWIW, +1 transformers. I like being able to swap monads-fd and monads-tf.
Michael

On Tue, Nov 17, 2009 at 09:09:07AM -0500, Edward Kmett wrote:
I like that transformers is Haskell 98 and presents a common core. I think that factoring it out is a laudable goal.
However, my very problem is that monads-fd and monads-tf are mutually incompatible. It fragments the community of monad combinator users even further.
If monads-fd sat in the existing location of mtl or was exported there by an mtl compatibility layer and monads-tf used a different namespace then you would have a clean solution in which both could be used in the same code, because both could be loaded.
The proposal is to make the next version of mtl a near-compatibility layer over monads-fd and transformers; it doesn't involve monads-tf directly. We could just rename all the modules in monads-tf (which aimed to mirror mtl-tf), or perhaps rename the modules in both monads-fd and monads-tf. Perhaps we should trim both packages to just the class modules (the others are re-exports mirroring mtl) and relocate those in the module hierarchy: Control.Monad.Cont.Class Control.Monad.Error.Class Control.Monad.RWS.Class Control.Monad.Reader.Class Control.Monad.State.Class Control.Monad.Writer.Class They both have the same Cont class; it need not be duplicated.

For symmetry I agree both should probably be renamed.
What are the current breaking changes?
I gather from the discussion that State is no longer separate from StateT,
along with Reader, Writer, RWS, Error, mutatis mutandis to obviate the need
for both a base monad and transformer.
I guess the question is then, when should code start looking to changing
their dependencies over to monads-tf and monads-fd?
A cleanly demarked cut over would be useful to get us out of this limbo
state that helps nobody.
-Edward Kmett
On Tue, Nov 17, 2009 at 11:04 AM, Ross Paterson
On Tue, Nov 17, 2009 at 09:09:07AM -0500, Edward Kmett wrote:
I like that transformers is Haskell 98 and presents a common core. I think that factoring it out is a laudable goal.
However, my very problem is that monads-fd and monads-tf are mutually incompatible. It fragments the community of monad combinator users even further.
If monads-fd sat in the existing location of mtl or was exported there by an mtl compatibility layer and monads-tf used a different namespace then you would have a clean solution in which both could be used in the same code, because both could be loaded.
The proposal is to make the next version of mtl a near-compatibility layer over monads-fd and transformers; it doesn't involve monads-tf directly. We could just rename all the modules in monads-tf (which aimed to mirror mtl-tf), or perhaps rename the modules in both monads-fd and monads-tf. Perhaps we should trim both packages to just the class modules (the others are re-exports mirroring mtl) and relocate those in the module hierarchy:
Control.Monad.Cont.Class Control.Monad.Error.Class Control.Monad.RWS.Class Control.Monad.Reader.Class Control.Monad.State.Class Control.Monad.Writer.Class
They both have the same Cont class; it need not be duplicated. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Tue, Nov 17, 2009 at 07:33:05PM -0500, Edward Kmett wrote:
For symmetry I agree both should probably be renamed.
Naming suggestions are welcome. Also comments on the idea of dropping the non-class modules from monads-*.
What are the current breaking changes?
I gather from the discussion that State is no longer separate from StateT, along with Reader, Writer, RWS, Error, mutatis mutandis to obviate the need for both a base monad and transformer.
Right, so modules that declare instances of State, etc, or use their data constructors, will break. In the former case the instances will in most cases become superfluous. Some packages declare orphan Applicative or Alternative instances, which will also become superfluous. The Functor instances in transformers depend on Functor rather than monad. The breakage can be fixed by adding functor instances.
I guess the question is then, when should code start looking to changing their dependencies over to monads-tf and monads-fd?
A cleanly demarked cut over would be useful to get us out of this limbo state that helps nobody.
According to Ganesh's survey, 17 packages (and their dependents) on hackage would be broken by turning mtl into a compatibility layer over transformers+monads-fd. They would need to be updated, but need not switch to monads-tf or monads-fd. Or they could avoid breakage by adding a dependency mtl < 2. Individual packages could switch to the new packages at their leisure. I agree that the current situation is problematic -- I think we should press on and replace the mtl.

On Wed, 2009-11-18 at 00:57 +0000, Ross Paterson wrote:
According to Ganesh's survey, 17 packages (and their dependents) on hackage would be broken by turning mtl into a compatibility layer over transformers+monads-fd. They would need to be updated, but need not switch to monads-tf or monads-fd. Or they could avoid breakage by adding a dependency mtl < 2. Individual packages could switch to the new packages at their leisure.
Ross, if the plan is to have the new combined package be mtl-2.x then you might as well go ahead and modify the preferred-versions[1] file to add: mtl < 2 Then cabal-install will then use the old mtl for all the old packages that do not use an upper bound. We should also add mtl to the list packages to check in Distribution/PackageDescription/Check.hs. At the moment it's hard-coded to be a list of 1 (base), so that'd need doing too. This would eventually be replaced by a generic way of opting into the regime. Or, if you all think the amount of breakage is not that great, and it'd be simpler just to fix the packages affected, then do nothing :-) If you are modifying the preferred-versions file, would you mind sticking in: cabal-install < 0.8 because I'm about to release both cabal-install-0.6.4 and 0.8.0, but I don't want everyone getting prompted to update to 0.8 immediately (cabal tells you when newer versions of itself are available). Duncan [1] http://hackage.haskell.org/packages/archive/preferred-versions

On Wed, Nov 18, 2009 at 06:04:24PM +0000, Duncan Coutts wrote:
Ross, if the plan is to have the new combined package be mtl-2.x then you might as well go ahead and modify the preferred-versions file to add:
mtl < 2
Then cabal-install will then use the old mtl for all the old packages that do not use an upper bound.
We should also add mtl to the list packages to check in Distribution/PackageDescription/Check.hs. At the moment it's hard-coded to be a list of 1 (base), so that'd need doing too. This would eventually be replaced by a generic way of opting into the regime.
Or, if you all think the amount of breakage is not that great, and it'd be simpler just to fix the packages affected, then do nothing :-)
I've just realized that it's not going to be as painless as we thought, and I'm not sure this is something preferred-versions can help with. (But I still think the transition is worth doing.) My original plan was to refactor mtl as transformers + monads-fd, so that together they'd offer a bunch of modules that were near-compatible with the modules of the same name in mtl. In only a tiny minority of cases would it be necessary to change code, but everyone would have to replace their dependencies on mtl with dependencies on transformers and monads-fd (though the latter wouldn't always be needed). Then Ganesh whipped up an mtl compatibility package, that re-exported modules from the two packages. Almost all the packages in hackage would compile unchanged if this package was mtl-2.0. But there's a problem: even if we rename the modules in monads-fd, we still have two modules in transformers that have the same names as modules in mtl, namely Control.Monad.Identity and Control.Monad.Trans. Renaming isn't an option: at least the first of those is the Right Name for the module concerned. People who build with cabal are fine: only the dependent packages are exposed, and all packages use the same type constructors, so the interfaces are compatible. But people who build with ghci or ghc --make will get the error message at the top of this thread: Could not find module `Control.Monad.Identity': it was found in multiple packages: mtl-2.0 transformers-0.1.4.0 So I think we're back at the original plan: a big bang replacement of dependencies on mtl with dependencies on transformers and monads-fd. (Unless we introduce virtual packages.) After that we could rename the FD-using modules slowly using the usual deprecation procedure. But we should rename the modules in monads-tf now -- all that needs is for someone to suggest good names.
If you are modifying the preferred-versions file, would you mind sticking in:
cabal-install < 0.8
done

Ross Paterson wrote:
But there's a problem: even if we rename the modules in monads-fd, we still have two modules in transformers that have the same names as modules in mtl, namely Control.Monad.Identity and Control.Monad.Trans. Renaming isn't an option: at least the first of those is the Right Name for the module concerned. People who build with cabal are fine: only the dependent packages are exposed, and all packages use the same type constructors, so the interfaces are compatible. But people who build with ghci or ghc --make will get the error message at the top of this thread:
Could not find module `Control.Monad.Identity': it was found in multiple packages: mtl-2.0 transformers-0.1.4.0
This is annoying, but can be worked around with -hide-package. We could also deprecate mtl as part of the migration, encouraging people to move away from it as quickly as possible. After a bit it could be removed from the platform, which would mean that people would only end up with it on their systems if they install it or something that still depends on it.
So I think we're back at the original plan: a big bang replacement of dependencies on mtl with dependencies on transformers and monads-fd.
I'd still favour doing things more gradually.
(Unless we introduce virtual packages.)
What functionality would virtual packages have? Presumably in this instance they'd need to provide some mechanism for GHC to recognise that you get the same result by importing the modules from either source. Cheers, Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================

On Tue, Nov 24, 2009 at 10:26:56AM -0000, Sittampalam, Ganesh wrote:
Ross Paterson wrote:
Could not find module `Control.Monad.Identity': it was found in multiple packages: mtl-2.0 transformers-0.1.4.0
This is annoying, but can be worked around with -hide-package. We could also deprecate mtl as part of the migration, encouraging people to move away from it as quickly as possible. After a bit it could be removed from the platform, which would mean that people would only end up with it on their systems if they install it or something that still depends on it.
So the proposal is that HP should contain mtl-2.0, monads-fd and transformers, but with mtl hidden. Could the HP do that?
(Unless we introduce virtual packages.)
What functionality would virtual packages have? Presumably in this instance they'd need to provide some mechanism for GHC to recognise that you get the same result by importing the modules from either source.
I was imagining something that would be implemented in Cabal, so you could say somewhere something like mtl >= 2 = transformers > 0.1.4.0, monads-fd >= 0.0.0.1 and Cabal would build packages with an unversioned dependency on mtl using the other two instead. That would still leave old versions of mtl needing hiding, though.

On Tue, Nov 17, 2009 at 6:33 PM, Edward Kmett
I gather from the discussion that State is no longer separate from StateT, along with Reader, Writer, RWS, Error, mutatis mutandis to obviate the need for both a base monad and transformer.
Every time this comes up I grow paranoid that there is some sort of general overhead to evaluating an expression of type "StateT s Identity a" vs "State s a". So I finally benchmarked it using the example code listed in Control.Monad.State, and found no difference whatsoever. Here's the source: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12259#a12259 I guess parsec is the odd one out, where there is a difference. Or I was measuring something else back when I had parsec benchmarks set up. Antoine

On Tuesday 17 November 2009 9:56:21 pm Antoine Latter wrote:
Every time this comes up I grow paranoid that there is some sort of general overhead to evaluating an expression of type "StateT s Identity a" vs "State s a".
So I finally benchmarked it using the example code listed in Control.Monad.State, and found no difference whatsoever.
Here's the source: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=12259#a12259
I guess parsec is the odd one out, where there is a difference. Or I was measuring something else back when I had parsec benchmarks set up.
At least in the State case, everything involved is a newtype, so: StateT s Identity a should be represented identically to: s -> Identity (a, s) = s -> (a, s) Which is exactly what State s a is. From there it's just up to the compiler to eliminate no-ops like: return :: a -> a -- return :: a -> Identity a return a = a which shouldn't be too arduous. Building up stacks of novel monads can introduce additional indirection over flattening them into a direct implementation (like StateT s (WriterT w ...) versus RWST r s w ...), but thankfully, Identity shouldn't introduce such overhead. -- Dan

On Tue, 17 Nov 2009, Edward Kmett wrote:
I guess the question is then, when should code start looking to changing their dependencies over to monads-tf and monads-fd?
A cleanly demarked cut over would be useful to get us out of this limbo state that helps nobody.
Are you suggesting that we declare a date or on which people should make the switch? I think that might make some sense if we weren't already accidentally part way through it, but given that we are, I'd say the best option is to just do it asap once there is proper agreement. Ganesh

On Wed, Nov 18, 2009 at 2:44 AM, Ganesh Sittampalam
On Tue, 17 Nov 2009, Edward Kmett wrote:
I guess the question is then, when should code start looking to changing
their dependencies over to monads-tf and monads-fd?
A cleanly demarked cut over would be useful to get us out of this limbo state that helps nobody.
Are you suggesting that we declare a date or on which people should make the switch? I think that might make some sense if we weren't already accidentally part way through it, but given that we are, I'd say the best option is to just do it asap once there is proper agreement.
Substantively, I agree -- assuming that the issues that keep monads-tf and monads-fd from being loaded into the same program are fixed, so that library writers don't have to go through all of this again almost immediately. -Edward Kmett
Ganesh
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Tue, 17 Nov 2009, Valery V. Vorotyntsev wrote:
Thus, the question is: are there any transformers-specific features iteratee package needs, or can it just go with mtl?
The question is, whether Iteratee needs functions of MTL that transformers does not provide? 'Transformers' is the more basic package, entirely Haskell 98, thus should be prefered. It is however sad, that Transformers cannot easily be used with GHCi in parallel with MTL installed. I was always against that ... Renaming Control.Monad.Trans and Control.Monad.Identity to something else would solve the conflict. I'm also not happy, that you have to choose between monads-fd and monads-tf. I think it would be better to be able to have both type class approaches.

Henning Thielemann wrote:
The question is, whether Iteratee needs functions of MTL that transformers does not provide? 'Transformers' is the more basic package, entirely Haskell 98, thus should be prefered. It is however sad, that Transformers cannot easily be used with GHCi in parallel with MTL installed. I was always against that ... Renaming Control.Monad.Trans and Control.Monad.Identity to something else would solve the conflict. I'm also not happy, that you have to choose between monads-fd and monads-tf. I think it would be better to be able to have both type class approaches.
Is there a way to tell GHCi ``Take Control.Monad.Trans from mtl package for this session'' or ``Use transformers this time'' without updating ghc-pkg config file (hide/expose)? If there is none, do you think inventing one would be a good idea? -- vvv

On Tue, 17 Nov 2009, Valery V. Vorotyntsev wrote:
Is there a way to tell GHCi ``Take Control.Monad.Trans from mtl package for this session'' or ``Use transformers this time'' without updating ghc-pkg config file (hide/expose)?
If there is none, do you think inventing one would be a good idea?
With 'ghc-pkg hide' and 'expose' you can set your general preference. With '-hide-package mtl' and '-package transformers' you can choose per invokation of GHCi.

Valery V. Vorotyntsev wrote:
Is there a way to tell GHCi ``Take Control.Monad.Trans from mtl package for this session'' or ``Use transformers this time'' without updating ghc-pkg config file (hide/expose)?
Henning Thielemann wrote:
With 'ghc-pkg hide' and 'expose' you can set your general preference. With '-hide-package mtl' and '-package transformers' you can choose per invokation of GHCi.
``When you say import A.B.C, from what package does A.B.C come?'' I've found [*] a hackage wiki page devoted to this question: http://hackage.haskell.org/trac/ghc/wiki/GhcPackages#Theopenquestion [*] I just tried to add `-hide-package mtl' to OPTIONS_GHC pragma, with no success, and was googling for a clue. Prelude> :load "/home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs" /home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs:1:15-39: unknown flag in {-# OPTIONS #-} pragma: -hide-package /home/vvv/job/cdr.mscp/Codec/Binary/MSCP.hs:1:15-39: unknown flag in {-# OPTIONS #-} pragma: mtl > -- vvv

On Nov 17, 2009, at 8:42 AM, Valery V. Vorotyntsev wrote:
[*] I just tried to add `-hide-package mtl' to OPTIONS_GHC pragma, with no success, and was googling for a clue.
I don't think that works, but you can do: {-# LANGUAGE PackageImports #-} import "transformers" Control.Monad.Reader in GHC 6.10 and higher. I think you could even do: {-# LANGUAGE PackageImports #-} import "transformers" Control.Monad.Reader import "mtl" Control.Monad.Writer - jeremy

Jeremy Shaw wrote:
I don't think that works, but you can do: {-# LANGUAGE PackageImports #-} import "transformers" Control.Monad.Reader in GHC 6.10 and higher. I think you could even do:
{-# LANGUAGE PackageImports #-} import "transformers" Control.Monad.Reader import "mtl" Control.Monad.Writer
Yes, this works! Thanks, Jeremy. -- vvv

Henning Thielemann wrote:
The question is, whether Iteratee needs functions of MTL that transformers does not provide?
For both the last version 0.2.4 and the current version 0.3.1, transformers can be replaced with MTL and still result in a working iteratee package. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
participants (14)
-
Antoine Latter
-
Dan Doel
-
Duncan Coutts
-
Edward Kmett
-
Erik de Castro Lopo
-
Ganesh Sittampalam
-
Henning Thielemann
-
Jeremy Shaw
-
Johan Tibell
-
Michael Snoyman
-
Nicolas Pouillard
-
Ross Paterson
-
Sittampalam, Ganesh
-
Valery V. Vorotyntsev