Re: [Haskell-cafe] mtl and transformers
Günther Schmidt wrote: Hi, when I cabal-installed the iteratee package, the transformers package was also installed as a dependency. Now when I run applications that import Control.Monad.Transformers I get this: Could not find module `Control.Monad.Trans': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 Another solution is to build your applications using Cabal and specify your dependency on mtl in the cabal file. HTH, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
Martijn van Steenbergen mart...@van.steenbergen.nl writes: Another solution is to build your applications using Cabal and specify your dependency on mtl in the cabal file. But until we have cabal ghci, this completely fails for actual hacking purposes... -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] mtl and transformers
Ivan Lazar Miljenovic wrote: Martijn van Steenbergen mart...@van.steenbergen.nl writes: Another solution is to build your applications using Cabal and specify your dependency on mtl in the cabal file. But until we have cabal ghci, this completely fails for actual hacking purposes... Just do cabal build -v, then cut and paste the ghc --make command-line and replace --make with --interactive. Obviously rather a hack, but remarkably usable in practice, in my experience. Ganesh === Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html === ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
On Mon, Jan 11, 2010 at 10:16 AM, Sittampalam, Ganesh ganesh.sittampa...@credit-suisse.com wrote: Ivan Lazar Miljenovic wrote: Martijn van Steenbergen mart...@van.steenbergen.nl writes: Another solution is to build your applications using Cabal and specify your dependency on mtl in the cabal file. But until we have cabal ghci, this completely fails for actual hacking purposes... Just do cabal build -v, then cut and paste the ghc --make command-line and replace --make with --interactive. Thanks for this tip! I always make a ghci.sh bash script in each of my projects that calls ghci -hide-all-packages -package x -package y -package z. However a cabal ghci or cabal interactive command that does this automatically would be ideal. I see there already is a ticket[1] about it. regards, Bas [1] http://hackage.haskell.org/trac/hackage/ticket/382 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
Bas van Dijk v.dijk@gmail.com wrote: I always make a ghci.sh bash script in each of my projects that calls ghci -hide-all-packages -package x -package y -package z. However a cabal ghci or cabal interactive command that does this automatically would be ideal. I see there already is a ticket[1] about it. regards, Bas [1] http://hackage.haskell.org/trac/hackage/ticket/382 Shell script can be replaced with .ghci file. See http://neilmitchell.blogspot.com/2010/01/using-ghci-files-to-run-projects.html (Just my two cents.) -- vvv ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
Günther Schmidt gue.schm...@web.de writes: Could not find module `Control.Monad.Trans': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 There's a way of specifying it at the top of whichever file you're using, but so far my workaround in this situation is to use ghc-pkg hide on whichever of those packages I don't use in my code. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
Hi Ivan, ghc-pkg hide works fine, thanks! Günther Am 11.01.10 03:49, schrieb Ivan Lazar Miljenovic: Günther Schmidtgue.schm...@web.de writes: Could not find module `Control.Monad.Trans': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 There's a way of specifying it at the top of whichever file you're using, but so far my workaround in this situation is to use ghc-pkg hide on whichever of those packages I don't use in my code. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mtl and transformers
Günther Schmidt: Could not find module `Control.Monad.Trans': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 Ivan Lazar Miljenovic: There's a way of specifying it at the top of whichever file you're using, but so far my workaround in this situation is to use ghc-pkg hide on whichever of those packages I don't use in my code. Günther Schmidt: ghc-pkg hide works fine, thanks! As an alternative, you can use `LANGUAGE PackageImports' pragma: | {-# LANGUAGE PackageImports #-} | | import transformers Control.Monad.Trans See http://thread.gmane.org/gmane.comp.lang.haskell.libraries/12134/focus=12155 PS: Have fun with iteratees! -- vvv ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
Erik de Castro Lopo wrote: However after reading the hackage descriptions of both Transformers and MTL, it seems that they share a very similar heritage. I therefore hacked the iteratee.cabal file and replaced the build-depends on transformers with one on mtl and the package built quite happily. I'll play with it a bit to see if its working correctly. I think the standard solutions are * use Cabal for your project and/or * use the PackageImports extension. HTH, Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
On Tuesday 13 October 2009 02:46:29 Erik de Castro Lopo wrote: Hi all, I've just received the following error message: headers.hs:6:7: Could not find module `Control.Monad.Identity': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 I'm trying to use the Iteratee module which depends on Transformers but I use MTL in other stuff. Whats the preferred solution here? Erik Hi, alternative to ghc-pkg: {-# LANGUAGE -XPackageImports #-} module Blub where import mtl Control.Monad.State -- Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
ghc-pkg hide transformers On Oct 12, 2009, at 5:46 PM, Erik de Castro Lopo wrote: Hi all, I've just received the following error message: headers.hs:6:7: Could not find module `Control.Monad.Identity': it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2 I'm trying to use the Iteratee module which depends on Transformers but I use MTL in other stuff. Whats the preferred solution here? Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
Erik de Castro Lopo wrote: Gregory Crosswhite wrote: ghc-pkg hide transformers Here's an example. CGI uses MTL, Iteratee uses Transformers. So, how do you use CGI and Iteratee in the same program? CGI is just one of many examples. Text.Regex, Network.HTTP, Database.HDBS.Sqlite, Tagsoup are others. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
Ugh, I'm not as sure about that... it took me long enough just to figure out ghc-pkg hide transformers! :-) Are running into problems because you need to refer to both packages (e.g., mtl and transformers) within your code, or because you are using packages that refer to each? Because as long as you only need to refer to one of them in your own code, GHC should be able to handle the dependencies for the other packages correctly. (Hiding the package only removes it from being automatically imported by your own code, it doesn't prevent it from being used by other packages that link to it.) Cheers, Greg On Oct 12, 2009, at 6:08 PM, Erik de Castro Lopo wrote: Gregory Crosswhite wrote: ghc-pkg hide transformers Here's an example. CGI uses MTL, Iteratee uses Transformers. So, how do you use CGI and Iteratee in the same program? Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MTL vs Transformers?
Gregory Crosswhite wrote: Are running into problems because you need to refer to both packages (e.g., mtl and transformers) within your code, or because you are using packages that refer to each? The later. Iteratee uses Transformers and just about everything else I want to use uses MTL. Because as long as you only need to refer to one of them in your own code, GHC should be able to handle the dependencies for the other packages correctly. (Hiding the package only removes it from being automatically imported by your own code, it doesn't prevent it from being used by other packages that link to it.) That all seems a little hackish. However after reading the hackage descriptions of both Transformers and MTL, it seems that they share a very similar heritage. I therefore hacked the iteratee.cabal file and replaced the build-depends on transformers with one on mtl and the package built quite happily. I'll play with it a bit to see if its working correctly. Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe