
Dear fellow Haskellers, last weak my Linux machine broke down and refused to start again. I bought a new one and installed a fresh new KDE/Linux distribution (Mint/Ubuntu) and it looks and feels awesome. I also installed the Haskell platform via the default GUI installer (mintInstall). But when I try to run my recovered Haskell modules again, strange things happen. First of all, I have a module that has a line import System and that used to be fine. But now, when I try to load the module in a ghci session, I get a complaint: Could not find module 'System' It is a member of the hidden package 'haskell98-2.0.0.1' ... The same happens if I do a Prelude> :m System What is going on? Secondly, I have another module that has a data type definition like this data (Show n, Show v, Ord n, Ord v) => Automaton n v = Automaton { nameSet :: Set.Set n, valueSet :: Set.Set v, .... } deriving (Show, Eq, Ord) and that used to work fine, too. But now, I get the complaint Illegal datatype context (use -XDatatypeContexts): (Show n, Show v, Ord n, Ord v) => But when I follow the advice and start the module file with a {-# LANGUAGE DatatypeContexts ... #-} I got the opposite complaint: Warning: -XDatatypeContexts is depracated: It was widely considered a misfeature, and has been removed from the Haskell language. How can I clean this up? Cheers, Tom

On Thu, Sep 20, 2012 at 10:18 AM, bucephalus org
Dear fellow Haskellers,
last weak my Linux machine broke down and refused to start again. I bought a new one and installed a fresh new KDE/Linux distribution (Mint/Ubuntu) and it looks and feels awesome. I also installed the Haskell platform via the default GUI installer (mintInstall). But when I try to run my recovered Haskell modules again, strange things happen.
That's because your reinstalled Haskell Platform is more recent than your old one, it brings a new version of GHC (7.4.1 probably) and this version has moved from Haskell 98 to Haskell 2010 for its defaults.
First of all, I have a module that has a line import System and that used to be fine. But now, when I try to load the module in a ghci session, I get a complaint: Could not find module 'System' It is a member of the hidden package 'haskell98-2.0.0.1' ... The same happens if I do a Prelude> :m System What is going on?
Haskell 2010 makes official the move from the old flat module namespace to the semi-hierarchical modules names so what used to be in System is now in System.Environment/Exit/.. you usually only need one. If you still want to use the old Haskell98 modules, you can expose the package haskell98 (which you do by adding "-package haskell98" to the command line or adding the package in the .cabal file)
Secondly, I have another module that has a data type definition like this data (Show n, Show v, Ord n, Ord v) => Automaton n v = Automaton { nameSet :: Set.Set n, valueSet :: Set.Set v, .... } deriving (Show, Eq, Ord) and that used to work fine, too. But now, I get the complaint Illegal datatype context (use -XDatatypeContexts): (Show n, Show v, Ord n, Ord v) => But when I follow the advice and start the module file with a {-# LANGUAGE DatatypeContexts ... #-} I got the opposite complaint: Warning: -XDatatypeContexts is depracated: It was widely considered a misfeature, and has been removed from the Haskell language. How can I clean this up?
Basically the context in "data (Show n, Show v, Ord n, Ord v) => Automaton n v" don't do what one would typically want it to do, that is it doesn't add it implicitly in functions that use the Automaton type, you have to do that yourself. So the Haskell committee decided to deprecate this misleading possibility, most people would do fine without (eventually documenting the expectations in an Haddock comment) or use GADTs instead that really works for those kind of things. So either you delete this (Show n...) context (moving it to documentation) which shouldn't have any effect on your program (major reason for this deprecation) or you just ignore the deprecation warning (it's just a warning after all). It's a brand new world ! And to compensate for those little problems, this new GHC probably compiles faster programs than your old one and offer some interesting new capacities (see the release notes). -- Jedaï

Hi Tom,
my 2 cents here:
it looks like you had an old version of GHC and now, it's a new!
My comments inline:
On Thu, Sep 20, 2012 at 10:18 AM, bucephalus org
Dear fellow Haskellers,
last weak my Linux machine broke down and refused to start again. I bought a new one and installed a fresh new KDE/Linux distribution (Mint/Ubuntu) and it looks and feels awesome. I also installed the Haskell platform via the default GUI installer (mintInstall). But when I try to run my recovered Haskell modules again, strange things happen.
First of all, I have a module that has a line import System and that used to be fine. But now, when I try to load the module in a ghci session, I get a complaint: Could not find module 'System' It is a member of the hidden package 'haskell98-2.0.0.1' ... The same happens if I do a Prelude> :m System What is going on?
Most likely you wanted to import System.IO
Secondly, I have another module that has a data type definition like this data (Show n, Show v, Ord n, Ord v) => Automaton n v = Automaton { nameSet :: Set.Set n, valueSet :: Set.Set v, .... } deriving (Show, Eq, Ord) and that used to work fine, too. But now, I get the complaint Illegal datatype context (use -XDatatypeContexts): (Show n, Show v, Ord n, Ord v) => But when I follow the advice and start the module file with a {-# LANGUAGE DatatypeContexts ... #-} I got the opposite complaint: Warning: -XDatatypeContexts is depracated: It was widely considered a misfeature, and has been removed from the Haskell language. How can I clean this up?
see http://stackoverflow.com/questions/7438600/datatypecontexts-deprecated-in-la... Generally (my fellow haskeller may correct me) I think that's better to put the class constraint on the methods rather than on the type declaration. So it becomes: data Automaton n v = Automaton { nameSet :: Set.Set n, valueSet :: Set.Set v } deriving (Show, Eq, Ord) createAutomaton :: (Show n, Show v, Ord n, Ord v) => n -> v -> Automaton n v createAutomaton n v = Automaton (singleton n) (singleton v) Best, Corentin
Cheers, Tom
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Dear Corentin, Dear Chaddai, Dear Lorenzo, Thank you for your replies, they explain everything I didn't understand. Only, I cannot find the new equivalent for the old System.system function, which doesn't appear anymore? At least not in http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-i... Actually, I always use it in a little helper file I apply in all my Haskell projects. For example, if a project has modules M1.hs and M2.hs, this helper file is -- helper.hs import System import M1 import M2 myhaddock = System.system "haddock -h M1.hs M2.hs" so that I can start each session simply with $ ghci Prelude> :l helper.hs and I can generate the docs M1.html and M2.html for my project simply with Main> myhaddock I could probably do all this with some built-in tools. For example there is Distribution.Simple.Haddock.haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> IO () but all this might be well programmed, but is so poorly documented, that I am not able figure that out. A while ago I did an intensive study on this whole Cabal, and at that stage I became really frustrated with Haskell. I had spent a lot of time in realizing two nice projects, but I was not able to cabalize and publish them. Since then, I am just waiting and hoping for a thorough introduction (beyond the overwhelming Cabal manual) that explains all that to mere mortals. Anyway, thank you very much again. Regards, Tom

On Thu, Sep 20, 2012 at 03:29:36PM +0200, bucephalus org wrote:
Dear Corentin, Dear Chaddai, Dear Lorenzo,
Thank you for your replies, they explain everything I didn't understand.
Only, I cannot find the new equivalent for the old System.system function, which doesn't appear anymore? At least not in
http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-i... Searching with Hoogle (haskell.org/hoogle) finds it immediately: http://www.haskell.org/hoogle/?q=system It now lives in System.Process, and is also re-exported by System.Cmd (the latter should be preferred if you only want to use the 'system' function and do not need any of the more complex interface provided by System.Process). -Brent

You probably want `System.Process.system`:
http://hackage.haskell.org/packages/archive/process/latest/doc/html/System-P...
L.
On Thu, Sep 20, 2012 at 2:29 PM, bucephalus org
Dear Corentin, Dear Chaddai, Dear Lorenzo,
Thank you for your replies, they explain everything I didn't understand.
Only, I cannot find the new equivalent for the old System.system function, which doesn't appear anymore? At least not in http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-i... ?
Actually, I always use it in a little helper file I apply in all my Haskell projects. For example, if a project has modules M1.hs and M2.hs, this helper file is -- helper.hs import System import M1 import M2 myhaddock = System.system "haddock -h M1.hs M2.hs" so that I can start each session simply with $ ghci Prelude> :l helper.hs and I can generate the docs M1.html and M2.html for my project simply with Main> myhaddock
I could probably do all this with some built-in tools. For example there is Distribution.Simple.Haddock.haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> IO () but all this might be well programmed, but is so poorly documented, that I am not able figure that out.
A while ago I did an intensive study on this whole Cabal, and at that stage I became really frustrated with Haskell. I had spent a lot of time in realizing two nice projects, but I was not able to cabalize and publish them. Since then, I am just waiting and hoping for a thorough introduction (beyond the overwhelming Cabal manual) that explains all that to mere mortals.
Anyway, thank you very much again. Regards, Tom
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Hi Brent, Hi Lorenzo,
Wow! Indeed, there it is.
Thank you!!
On Thu, Sep 20, 2012 at 3:37 PM, Lorenzo Bolla
You probably want `System.Process.system`:
http://hackage.haskell.org/packages/archive/process/latest/doc/html/System-P...
L.
On Thu, Sep 20, 2012 at 2:29 PM, bucephalus org
wrote: Dear Corentin, Dear Chaddai, Dear Lorenzo,
Thank you for your replies, they explain everything I didn't understand.
Only, I cannot find the new equivalent for the old System.system function, which doesn't appear anymore? At least not in
http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-i...
?
Actually, I always use it in a little helper file I apply in all my Haskell projects. For example, if a project has modules M1.hs and M2.hs, this helper file is -- helper.hs import System import M1 import M2 myhaddock = System.system "haddock -h M1.hs M2.hs" so that I can start each session simply with $ ghci Prelude> :l helper.hs and I can generate the docs M1.html and M2.html for my project simply with Main> myhaddock
I could probably do all this with some built-in tools. For example there is Distribution.Simple.Haddock.haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> IO () but all this might be well programmed, but is so poorly documented, that I am not able figure that out.
A while ago I did an intensive study on this whole Cabal, and at that stage I became really frustrated with Haskell. I had spent a lot of time in realizing two nice projects, but I was not able to cabalize and publish them. Since then, I am just waiting and hoping for a thorough introduction (beyond the overwhelming Cabal manual) that explains all that to mere mortals.
Anyway, thank you very much again. Regards, Tom
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (5)
-
Brent Yorgey
-
bucephalus org
-
Chaddaï Fouché
-
Corentin Dupont
-
Lorenzo Bolla