
How do I import Control.Monad.State? I see this note in http://en.wikibooks.org/wiki/Haskell/Understanding_monads/State Note: in some package systems used for GHC, the Control.Monad.State module is in a separate package, usually indicated by MTL (Monad Transformer Library). Michael ===============rand.hs ============== import Control.Monad.State type GeneratorState = State StdGen rollDie :: GeneratorState Int rollDie = do generator <- get let( value, newGenerator ) = randomR (1,6) generator put newGenerator return value ======================= [michael@localhost ~]$ ghci rand GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. rand.hs:1:7: Could not find module `Control.Monad.State': Use -v to see a list of the files searched for. Failed, modules loaded: none. Prelude>

On 28 July 2010 12:39, michael rice
How do I import Control.Monad.State?
Install and use the mtl library (comes with the Haskell platform), monads-fd (almost identical API to mtl; the point of this is that mtl uses some extension: the non-extension bits are in the transformers library and monads-fd extends transformers by using extensions to implement mtl functionality) or monads-tf (a different approach to what monads-fd does using different extensions). To check if you have mtl installed (substitute the other package names if necessary): ghc-pkg list mtl If it isn't installed, you can use cabal-install to install it: cabal install mtl -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

[michael@localhost ~]$ ghc-pkg list mtl
/usr/lib/ghc-6.12.1/package.conf.d
[michael@localhost ~]$
Installed?
Michael
--- On Tue, 7/27/10, Ivan Miljenovic
How do I import Control.Monad.State?
Install and use the mtl library (comes with the Haskell platform), monads-fd (almost identical API to mtl; the point of this is that mtl uses some extension: the non-extension bits are in the transformers library and monads-fd extends transformers by using extensions to implement mtl functionality) or monads-tf (a different approach to what monads-fd does using different extensions). To check if you have mtl installed (substitute the other package names if necessary): ghc-pkg list mtl If it isn't installed, you can use cabal-install to install it: cabal install mtl -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On 28 July 2010 13:03, michael rice
[michael@localhost ~]$ ghc-pkg list mtl /usr/lib/ghc-6.12.1/package.conf.d [michael@localhost ~]$
Installed?
No; if it was installed it would specify a version.
Michael
--- On Tue, 7/27/10, Ivan Miljenovic
wrote: From: Ivan Miljenovic
Subject: Re: [Haskell-cafe] Need Control.Monad.State To: "michael rice" Cc: haskell-cafe@haskell.org Date: Tuesday, July 27, 2010, 10:51 PM On 28 July 2010 12:39, michael rice
wrote: How do I import Control.Monad.State?
Install and use the mtl library (comes with the Haskell platform), monads-fd (almost identical API to mtl; the point of this is that mtl uses some extension: the non-extension bits are in the transformers library and monads-fd extends transformers by using extensions to implement mtl functionality) or monads-tf (a different approach to what monads-fd does using different extensions).
To check if you have mtl installed (substitute the other package names if necessary):
ghc-pkg list mtl
If it isn't installed, you can use cabal-install to install it:
cabal install mtl
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On Wed, Jul 28, 2010 at 12:04 AM, Ivan Miljenovic
On 28 July 2010 13:03, michael rice
wrote: [michael@localhost ~]$ ghc-pkg list mtl /usr/lib/ghc-6.12.1/package.conf.d [michael@localhost ~]$
Installed?
No; if it was installed it would specify a version.
For example: $ ghc-pkg list mtl /usr/lib64/ghc-6.12.3/package.conf.d mtl-1.1.0.2 -- Felipe.

See below. Lot's of warnings. Is the install OK? If so, can I use the same *import*?
Michael
--- On Tue, 7/27/10, Ivan Miljenovic
If it isn't installed, you can use cabal-install to install it:
cabal install mtl
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
[michael@localhost ~]$ cabal install mtl Resolving dependencies... Downloading mtl-1.1.0.2... Configuring mtl-1.1.0.2... Preprocessing library mtl-1.1.0.2... Building mtl-1.1.0.2... [ 1 of 21] Compiling Control.Monad.Identity ( Control/Monad/Identity.hs, dist/build/Control/Monad/Identity.o ) Control/Monad/Cont.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Cont/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Error.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Error/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Identity.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Control/Monad/List.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/RWS/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/RWS/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Reader.hs:2:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Reader/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/State/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/State/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Writer.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Writer/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Writer/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead Control/Monad/Writer/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead [ 2 of 21] Compiling Control.Monad.Writer.Class ( Control/Monad/Writer/Class.hs, dist/build/Control/Monad/Writer/Class.o ) Control/Monad/Writer/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 3 of 21] Compiling Control.Monad.Error.Class ( Control/Monad/Error/Class.hs, dist/build/Control/Monad/Error/Class.o ) Control/Monad/Error/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 4 of 21] Compiling Control.Monad.State.Class ( Control/Monad/State/Class.hs, dist/build/Control/Monad/State/Class.o ) Control/Monad/State/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 5 of 21] Compiling Control.Monad.Reader.Class ( Control/Monad/Reader/Class.hs, dist/build/Control/Monad/Reader/Class.o ) Control/Monad/Reader/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 6 of 21] Compiling Control.Monad.RWS.Class ( Control/Monad/RWS/Class.hs, dist/build/Control/Monad/RWS/Class.o ) Control/Monad/RWS/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 7 of 21] Compiling Control.Monad.Trans ( Control/Monad/Trans.hs, dist/build/Control/Monad/Trans.o ) Control/Monad/Trans.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Control/Monad/Trans.hs:26:0: Warning: The import of `System.IO' is redundant except perhaps to import instances from `System.IO' To import instances alone, use: import System.IO() [ 8 of 21] Compiling Control.Monad.Cont.Class ( Control/Monad/Cont/Class.hs, dist/build/Control/Monad/Cont/Class.o ) Control/Monad/Cont/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 9 of 21] Compiling Control.Monad.Reader ( Control/Monad/Reader.hs, dist/build/Control/Monad/Reader.o ) Control/Monad/Reader.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [10 of 21] Compiling Control.Monad.Error ( Control/Monad/Error.hs, dist/build/Control/Monad/Error.o ) Control/Monad/Error.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Control/Monad/Error.hs:57:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class() Control/Monad/Error.hs:58:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class() Control/Monad/Error.hs:60:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class() Control/Monad/Error.hs:63:0: Warning: The import of `System.IO' is redundant except perhaps to import instances from `System.IO' To import instances alone, use: import System.IO() [11 of 21] Compiling Control.Monad.List ( Control/Monad/List.hs, dist/build/Control/Monad/List.o ) Control/Monad/List.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [12 of 21] Compiling Control.Monad.RWS.Lazy ( Control/Monad/RWS/Lazy.hs, dist/build/Control/Monad/RWS/Lazy.o ) Control/Monad/RWS/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Control/Monad/RWS/Lazy.hs:45:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class() Control/Monad/RWS/Lazy.hs:46:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class() Control/Monad/RWS/Lazy.hs:48:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class() [13 of 21] Compiling Control.Monad.RWS ( Control/Monad/RWS.hs, dist/build/Control/Monad/RWS.o ) Control/Monad/RWS.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [14 of 21] Compiling Control.Monad.RWS.Strict ( Control/Monad/RWS/Strict.hs, dist/build/Control/Monad/RWS/Strict.o ) Control/Monad/RWS/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Control/Monad/RWS/Strict.hs:45:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class() Control/Monad/RWS/Strict.hs:46:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class() Control/Monad/RWS/Strict.hs:48:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class() [15 of 21] Compiling Control.Monad.State.Lazy ( Control/Monad/State/Lazy.hs, dist/build/Control/Monad/State/Lazy.o ) Control/Monad/State/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [16 of 21] Compiling Control.Monad.State ( Control/Monad/State.hs, dist/build/Control/Monad/State.o ) Control/Monad/State.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [17 of 21] Compiling Control.Monad.State.Strict ( Control/Monad/State/Strict.hs, dist/build/Control/Monad/State/Strict.o ) Control/Monad/State/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [18 of 21] Compiling Control.Monad.Writer.Lazy ( Control/Monad/Writer/Lazy.hs, dist/build/Control/Monad/Writer/Lazy.o ) Control/Monad/Writer/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [19 of 21] Compiling Control.Monad.Writer ( Control/Monad/Writer.hs, dist/build/Control/Monad/Writer.o ) Control/Monad/Writer.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [20 of 21] Compiling Control.Monad.Writer.Strict ( Control/Monad/Writer/Strict.hs, dist/build/Control/Monad/Writer/Strict.o ) Control/Monad/Writer/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [21 of 21] Compiling Control.Monad.Cont ( Control/Monad/Cont.hs, dist/build/Control/Monad/Cont.o ) Control/Monad/Cont.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Registering mtl-1.1.0.2... Installing library in /home/michael/.cabal/lib/mtl-1.1.0.2/ghc-6.12.1 Registering mtl-1.1.0.2... [michael@localhost ~]$

On 28 July 2010 13:17, michael rice
See below. Lot's of warnings. Is the install OK? If so, can I use the same *import*?
Yeah, the install is OK. The meaning of the warnings are: * "Warning: -fallow-undecidable-instances is deprecated:" this GHC option has changed name, but the mtl package still uses the old name. * "Warning: Module `Prelude' is deprecated:" mtl doesn't specify any bounds on the version of the base library to be used (mainly because of historic reasons when it wasn't changing much and the Haskell community wasn't stressing versioning as much; note that the last version of mtl was released almost 2 years ago). Because a lot of packages broke when GHC-6.10.4 started shipping with base-4 (along with base-3 for compatability purposes) due to the differences in how exceptions were handled, if there is no upper bound on the version of base to be used then cabal-install plays it safe and uses base-3. However, the next version of GHC (6.14, which should be coming out later this year) will not ship with base-3, so GHC-6.12 included that warning message for people that kept trying to use base-3 that their code won't work with 6.14. So yes, now you can use "import Control.Monad.State".
Michael
--- On Tue, 7/27/10, Ivan Miljenovic
wrote: If it isn't installed, you can use cabal-install to install it:
cabal install mtl
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
[michael@localhost ~]$ cabal install mtl Resolving dependencies... Downloading mtl-1.1.0.2... Configuring mtl-1.1.0.2... Preprocessing library mtl-1.1.0.2... Building mtl-1.1.0.2... [ 1 of 21] Compiling Control.Monad.Identity ( Control/Monad/Identity.hs, dist/build/Control/Monad/Identity.o )
Control/Monad/Cont.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Cont/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Error.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Error/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Identity.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x.
Control/Monad/List.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/RWS/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/RWS/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Reader.hs:2:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Reader/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/State/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/State/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Writer.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Writer/Class.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Writer/Lazy.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead
Control/Monad/Writer/Strict.hs:1:11: Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-} instead [ 2 of 21] Compiling Control.Monad.Writer.Class ( Control/Monad/Writer/Class.hs, dist/build/Control/Monad/Writer/Class.o )
Control/Monad/Writer/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 3 of 21] Compiling Control.Monad.Error.Class ( Control/Monad/Error/Class.hs, dist/build/Control/Monad/Error/Class.o )
Control/Monad/Error/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 4 of 21] Compiling Control.Monad.State.Class ( Control/Monad/State/Class.hs, dist/build/Control/Monad/State/Class.o )
Control/Monad/State/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 5 of 21] Compiling Control.Monad.Reader.Class ( Control/Monad/Reader/Class.hs, dist/build/Control/Monad/Reader/Class.o )
Control/Monad/Reader/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 6 of 21] Compiling Control.Monad.RWS.Class ( Control/Monad/RWS/Class.hs, dist/build/Control/Monad/RWS/Class.o )
Control/Monad/RWS/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 7 of 21] Compiling Control.Monad.Trans ( Control/Monad/Trans.hs, dist/build/Control/Monad/Trans.o )
Control/Monad/Trans.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x.
Control/Monad/Trans.hs:26:0: Warning: The import of `System.IO' is redundant except perhaps to import instances from `System.IO' To import instances alone, use: import System.IO() [ 8 of 21] Compiling Control.Monad.Cont.Class ( Control/Monad/Cont/Class.hs, dist/build/Control/Monad/Cont/Class.o )
Control/Monad/Cont/Class.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [ 9 of 21] Compiling Control.Monad.Reader ( Control/Monad/Reader.hs, dist/build/Control/Monad/Reader.o )
Control/Monad/Reader.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [10 of 21] Compiling Control.Monad.Error ( Control/Monad/Error.hs, dist/build/Control/Monad/Error.o )
Control/Monad/Error.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x.
Control/Monad/Error.hs:57:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class()
Control/Monad/Error.hs:58:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class()
Control/Monad/Error.hs:60:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class()
Control/Monad/Error.hs:63:0: Warning: The import of `System.IO' is redundant except perhaps to import instances from `System.IO' To import instances alone, use: import System.IO() [11 of 21] Compiling Control.Monad.List ( Control/Monad/List.hs, dist/build/Control/Monad/List.o )
Control/Monad/List.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [12 of 21] Compiling Control.Monad.RWS.Lazy ( Control/Monad/RWS/Lazy.hs, dist/build/Control/Monad/RWS/Lazy.o )
Control/Monad/RWS/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x.
Control/Monad/RWS/Lazy.hs:45:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class()
Control/Monad/RWS/Lazy.hs:46:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class()
Control/Monad/RWS/Lazy.hs:48:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class() [13 of 21] Compiling Control.Monad.RWS ( Control/Monad/RWS.hs, dist/build/Control/Monad/RWS.o )
Control/Monad/RWS.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [14 of 21] Compiling Control.Monad.RWS.Strict ( Control/Monad/RWS/Strict.hs, dist/build/Control/Monad/RWS/Strict.o )
Control/Monad/RWS/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x.
Control/Monad/RWS/Strict.hs:45:0: Warning: The import of `Control.Monad.Reader.Class' is redundant except perhaps to import instances from `Control.Monad.Reader.Class' To import instances alone, use: import Control.Monad.Reader.Class()
Control/Monad/RWS/Strict.hs:46:0: Warning: The import of `Control.Monad.State.Class' is redundant except perhaps to import instances from `Control.Monad.State.Class' To import instances alone, use: import Control.Monad.State.Class()
Control/Monad/RWS/Strict.hs:48:0: Warning: The import of `Control.Monad.Writer.Class' is redundant except perhaps to import instances from `Control.Monad.Writer.Class' To import instances alone, use: import Control.Monad.Writer.Class() [15 of 21] Compiling Control.Monad.State.Lazy ( Control/Monad/State/Lazy.hs, dist/build/Control/Monad/State/Lazy.o )
Control/Monad/State/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [16 of 21] Compiling Control.Monad.State ( Control/Monad/State.hs, dist/build/Control/Monad/State.o )
Control/Monad/State.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [17 of 21] Compiling Control.Monad.State.Strict ( Control/Monad/State/Strict.hs, dist/build/Control/Monad/State/Strict.o )
Control/Monad/State/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [18 of 21] Compiling Control.Monad.Writer.Lazy ( Control/Monad/Writer/Lazy.hs, dist/build/Control/Monad/Writer/Lazy.o )
Control/Monad/Writer/Lazy.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [19 of 21] Compiling Control.Monad.Writer ( Control/Monad/Writer.hs, dist/build/Control/Monad/Writer.o )
Control/Monad/Writer.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [20 of 21] Compiling Control.Monad.Writer.Strict ( Control/Monad/Writer/Strict.hs, dist/build/Control/Monad/Writer/Strict.o )
Control/Monad/Writer/Strict.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. [21 of 21] Compiling Control.Monad.Cont ( Control/Monad/Cont.hs, dist/build/Control/Monad/Cont.o )
Control/Monad/Cont.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Registering mtl-1.1.0.2... Installing library in /home/michael/.cabal/lib/mtl-1.1.0.2/ghc-6.12.1 Registering mtl-1.1.0.2... [michael@localhost ~]$
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

I didn't realize the State monad wasn't part of the base install. Any
particular reason for this?
-deech
On Tue, Jul 27, 2010 at 10:24 PM, Ivan Miljenovic wrote: On 28 July 2010 13:17, michael rice See below. Lot's of warnings. Is the install OK? If so, can I use the same *import*? Yeah, the install is OK. The meaning of the warnings are: * "Warning: -fallow-undecidable-instances is deprecated:" this GHC
option has changed name, but the mtl package still uses the old name. * "Warning: Module `Prelude' is deprecated:" mtl doesn't specify any
bounds on the version of the base library to be used (mainly because
of historic reasons when it wasn't changing much and the Haskell
community wasn't stressing versioning as much; note that the last
version of mtl was released almost 2 years ago). Because a lot of
packages broke when GHC-6.10.4 started shipping with base-4 (along
with base-3 for compatability purposes) due to the differences in how
exceptions were handled, if there is no upper bound on the version of
base to be used then cabal-install plays it safe and uses base-3.
However, the next version of GHC (6.14, which should be coming out
later this year) will not ship with base-3, so GHC-6.12 included that
warning message for people that kept trying to use base-3 that their
code won't work with 6.14. So yes, now you can use "import Control.Monad.State". Michael --- On Tue, 7/27/10, Ivan Miljenovic If it isn't installed, you can use cabal-install to install it: cabal install mtl --
Ivan Lazar Miljenovic
Ivan.Miljenovic@gmail.com
IvanMiljenovic.wordpress.com [michael@localhost ~]$ cabal install mtl
Resolving dependencies...
Downloading mtl-1.1.0.2...
Configuring mtl-1.1.0.2...
Preprocessing library mtl-1.1.0.2...
Building mtl-1.1.0.2...
[ 1 of 21] Compiling Control.Monad.Identity ( Control/Monad/Identity.hs, dist/build/Control/Monad/Identity.o ) Control/Monad/Cont.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Cont/Class.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Error.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Error/Class.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Identity.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x. Control/Monad/List.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/RWS/Lazy.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/RWS/Strict.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Reader.hs:2:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Reader/Class.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/State/Lazy.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/State/Strict.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Writer.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Writer/Class.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Writer/Lazy.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead Control/Monad/Writer/Strict.hs:1:11:
Warning: -fallow-undecidable-instances is deprecated: use -XUndecidableInstances or pragma {-# LANGUAGE UndecidableInstances #-}
instead [ 2 of 21] Compiling Control.Monad.Writer.Class (
Control/Monad/Writer/Class.hs, dist/build/Control/Monad/Writer/Class.o ) Control/Monad/Writer/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 3 of 21] Compiling Control.Monad.Error.Class (
Control/Monad/Error/Class.hs, dist/build/Control/Monad/Error/Class.o ) Control/Monad/Error/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 4 of 21] Compiling Control.Monad.State.Class (
Control/Monad/State/Class.hs, dist/build/Control/Monad/State/Class.o ) Control/Monad/State/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 5 of 21] Compiling Control.Monad.Reader.Class (
Control/Monad/Reader/Class.hs, dist/build/Control/Monad/Reader/Class.o ) Control/Monad/Reader/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 6 of 21] Compiling Control.Monad.RWS.Class (
Control/Monad/RWS/Class.hs, dist/build/Control/Monad/RWS/Class.o ) Control/Monad/RWS/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 7 of 21] Compiling Control.Monad.Trans ( Control/Monad/Trans.hs,
dist/build/Control/Monad/Trans.o ) Control/Monad/Trans.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x. Control/Monad/Trans.hs:26:0:
Warning: The import of `System.IO' is redundant
except perhaps to import instances from `System.IO'
To import instances alone, use: import System.IO()
[ 8 of 21] Compiling Control.Monad.Cont.Class (
Control/Monad/Cont/Class.hs, dist/build/Control/Monad/Cont/Class.o ) Control/Monad/Cont/Class.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[ 9 of 21] Compiling Control.Monad.Reader ( Control/Monad/Reader.hs,
dist/build/Control/Monad/Reader.o ) Control/Monad/Reader.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[10 of 21] Compiling Control.Monad.Error ( Control/Monad/Error.hs,
dist/build/Control/Monad/Error.o ) Control/Monad/Error.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x. Control/Monad/Error.hs:57:0:
Warning: The import of `Control.Monad.Reader.Class' is redundant
except perhaps to import instances from
`Control.Monad.Reader.Class'
To import instances alone, use: import
Control.Monad.Reader.Class() Control/Monad/Error.hs:58:0:
Warning: The import of `Control.Monad.State.Class' is redundant
except perhaps to import instances from
`Control.Monad.State.Class'
To import instances alone, use: import
Control.Monad.State.Class() Control/Monad/Error.hs:60:0:
Warning: The import of `Control.Monad.Writer.Class' is redundant
except perhaps to import instances from
`Control.Monad.Writer.Class'
To import instances alone, use: import
Control.Monad.Writer.Class() Control/Monad/Error.hs:63:0:
Warning: The import of `System.IO' is redundant
except perhaps to import instances from `System.IO'
To import instances alone, use: import System.IO()
[11 of 21] Compiling Control.Monad.List ( Control/Monad/List.hs,
dist/build/Control/Monad/List.o ) Control/Monad/List.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[12 of 21] Compiling Control.Monad.RWS.Lazy ( Control/Monad/RWS/Lazy.hs,
dist/build/Control/Monad/RWS/Lazy.o ) Control/Monad/RWS/Lazy.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x. Control/Monad/RWS/Lazy.hs:45:0:
Warning: The import of `Control.Monad.Reader.Class' is redundant
except perhaps to import instances from
`Control.Monad.Reader.Class'
To import instances alone, use: import
Control.Monad.Reader.Class() Control/Monad/RWS/Lazy.hs:46:0:
Warning: The import of `Control.Monad.State.Class' is redundant
except perhaps to import instances from
`Control.Monad.State.Class'
To import instances alone, use: import
Control.Monad.State.Class() Control/Monad/RWS/Lazy.hs:48:0:
Warning: The import of `Control.Monad.Writer.Class' is redundant
except perhaps to import instances from
`Control.Monad.Writer.Class'
To import instances alone, use: import
Control.Monad.Writer.Class()
[13 of 21] Compiling Control.Monad.RWS ( Control/Monad/RWS.hs,
dist/build/Control/Monad/RWS.o ) Control/Monad/RWS.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[14 of 21] Compiling Control.Monad.RWS.Strict (
Control/Monad/RWS/Strict.hs, dist/build/Control/Monad/RWS/Strict.o ) Control/Monad/RWS/Strict.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x. Control/Monad/RWS/Strict.hs:45:0:
Warning: The import of `Control.Monad.Reader.Class' is redundant
except perhaps to import instances from
`Control.Monad.Reader.Class'
To import instances alone, use: import
Control.Monad.Reader.Class() Control/Monad/RWS/Strict.hs:46:0:
Warning: The import of `Control.Monad.State.Class' is redundant
except perhaps to import instances from
`Control.Monad.State.Class'
To import instances alone, use: import
Control.Monad.State.Class() Control/Monad/RWS/Strict.hs:48:0:
Warning: The import of `Control.Monad.Writer.Class' is redundant
except perhaps to import instances from
`Control.Monad.Writer.Class'
To import instances alone, use: import
Control.Monad.Writer.Class()
[15 of 21] Compiling Control.Monad.State.Lazy (
Control/Monad/State/Lazy.hs, dist/build/Control/Monad/State/Lazy.o ) Control/Monad/State/Lazy.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[16 of 21] Compiling Control.Monad.State ( Control/Monad/State.hs,
dist/build/Control/Monad/State.o ) Control/Monad/State.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[17 of 21] Compiling Control.Monad.State.Strict (
Control/Monad/State/Strict.hs, dist/build/Control/Monad/State/Strict.o ) Control/Monad/State/Strict.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[18 of 21] Compiling Control.Monad.Writer.Lazy (
Control/Monad/Writer/Lazy.hs, dist/build/Control/Monad/Writer/Lazy.o ) Control/Monad/Writer/Lazy.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[19 of 21] Compiling Control.Monad.Writer ( Control/Monad/Writer.hs,
dist/build/Control/Monad/Writer.o ) Control/Monad/Writer.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[20 of 21] Compiling Control.Monad.Writer.Strict (
Control/Monad/Writer/Strict.hs, dist/build/Control/Monad/Writer/Strict.o ) Control/Monad/Writer/Strict.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
[21 of 21] Compiling Control.Monad.Cont ( Control/Monad/Cont.hs,
dist/build/Control/Monad/Cont.o ) Control/Monad/Cont.hs:1:0:
Warning: Module `Prelude' is deprecated:
You are using the old package `base' version 3.x.
Future GHC versions will not support base version 3.x. You
should update your code to use the new base version 4.x.
Registering mtl-1.1.0.2...
Installing library in /home/michael/.cabal/lib/mtl-1.1.0.2/ghc-6.12.1
Registering mtl-1.1.0.2...
[michael@localhost ~]$ --
Ivan Lazar Miljenovic
Ivan.Miljenovic@gmail.com
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

On 28 July 2010 14:07, aditya siram
I didn't realize the State monad wasn't part of the base install. Any particular reason for this?
Because there's no reason for it to be? GHC is bundled with enough libraries as it is (and with the exception of Cabal, it's not safe to upgrade any of them). However, mtl _is_ part of the Haskell Platform, so in that sense it's part of the _recommended_ base install... -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (4)
-
aditya siram
-
Felipe Lessa
-
Ivan Miljenovic
-
michael rice