Xmonad no longer compile since latest darcs pull

Hello, Since my latest darcs pull, my config.hs file refuses to compile with this error: [ 1 of 21] Compiling StackSet ( StackSet.hs, dist/build/xmonad/xmonad-tmp/StackSet.o ) [ 2 of 21] Compiling XMonad ( XMonad.hs, dist/build/xmonad/xmonad-tmp/XMonad.o ) [ 3 of 21] Compiling XMonadContrib.Dmenu ( XMonadContrib/Dmenu.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Dmenu.o ) [ 4 of 21] Compiling XMonadContrib.LayoutHelpers ( XMonadContrib/LayoutHelpers.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/LayoutHelpers.o ) [ 5 of 21] Compiling XMonadContrib.Circle ( XMonadContrib/Circle.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Circle.o ) [ 6 of 21] Compiling XMonadContrib.SimpleStacking ( XMonadContrib/SimpleStacking.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/SimpleStacking.o ) [ 7 of 21] Compiling XMonadContrib.NamedWindows ( XMonadContrib/NamedWindows.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/NamedWindows.o ) [ 8 of 21] Compiling XMonadContrib.DynamicLog ( XMonadContrib/DynamicLog.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/DynamicLog.o ) [ 9 of 21] Compiling Config[boot] ( Config.hs-boot, nothing ) [10 of 21] Compiling Operations ( Operations.hs, dist/build/xmonad/xmonad-tmp/Operations.o ) [11 of 21] Compiling XMonadContrib.XPrompt ( XMonadContrib/XPrompt.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/XPrompt.o ) [12 of 21] Compiling XMonadContrib.DwmPromote ( XMonadContrib/DwmPromote.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/DwmPromote.o ) [13 of 21] Compiling XMonadContrib.Roledex ( XMonadContrib/Roledex.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Roledex.o ) XMonadContrib/Roledex.hs:61:0: Warning: Definition but no type signature for `div'' [14 of 21] Compiling XMonadContrib.LayoutScreens ( XMonadContrib/LayoutScreens.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/LayoutScreens.o ) [15 of 21] Compiling XMonadContrib.TwoPane ( XMonadContrib/TwoPane.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/TwoPane.o ) [16 of 21] Compiling XMonadContrib.Decoration ( XMonadContrib/Decoration.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Decoration.o ) [17 of 21] Compiling XMonadContrib.Tabbed ( XMonadContrib/Tabbed.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Tabbed.o ) [18 of 21] Compiling XMonadContrib.Commands ( XMonadContrib/Commands.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Commands.o ) [19 of 21] Compiling XMonadContrib.XMonadPrompt ( XMonadContrib/XMonadPrompt.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/XMonadPrompt.o ) [20 of 21] Compiling Config ( Config.hs, dist/build/xmonad/xmonad-tmp/Config.o ) Config.hs:1:0: Identifier `Config.workspaces' has conflicting definitions in the module and its hs-boot file Installing: /tmp/build/xmonad/usr/lib/ghc-6.6.1/site-local/ xmonad-0.3darcs & /tmp/build/xmonad/usr/bin xmonad-0.2... *** Exception: dist/build/xmonad/xmonad: copyFile: does not exist (No such file or directory) As I am still not a haskell developer, I do not know what to change :) Regards, Xavier

maillaxa:
Hello,
Since my latest darcs pull, my config.hs file refuses to compile with this error:
[ 1 of 21] Compiling StackSet ( StackSet.hs, dist/build/xmonad/xmonad-tmp/StackSet.o ) [ 2 of 21] Compiling XMonad ( XMonad.hs, dist/build/xmonad/xmonad-tmp/XMonad.o ) [ 3 of 21] Compiling XMonadContrib.Dmenu ( XMonadContrib/Dmenu.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Dmenu.o ) [ 4 of 21] Compiling XMonadContrib.LayoutHelpers ( XMonadContrib/LayoutHelpers.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/LayoutHelpers.o ) [ 5 of 21] Compiling XMonadContrib.Circle ( XMonadContrib/Circle.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Circle.o ) [ 6 of 21] Compiling XMonadContrib.SimpleStacking ( XMonadContrib/SimpleStacking.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/SimpleStacking.o ) [ 7 of 21] Compiling XMonadContrib.NamedWindows ( XMonadContrib/NamedWindows.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/NamedWindows.o ) [ 8 of 21] Compiling XMonadContrib.DynamicLog ( XMonadContrib/DynamicLog.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/DynamicLog.o ) [ 9 of 21] Compiling Config[boot] ( Config.hs-boot, nothing ) [10 of 21] Compiling Operations ( Operations.hs, dist/build/xmonad/xmonad-tmp/Operations.o ) [11 of 21] Compiling XMonadContrib.XPrompt ( XMonadContrib/XPrompt.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/XPrompt.o ) [12 of 21] Compiling XMonadContrib.DwmPromote ( XMonadContrib/DwmPromote.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/DwmPromote.o ) [13 of 21] Compiling XMonadContrib.Roledex ( XMonadContrib/Roledex.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Roledex.o )
XMonadContrib/Roledex.hs:61:0: Warning: Definition but no type signature for `div'' [14 of 21] Compiling XMonadContrib.LayoutScreens ( XMonadContrib/LayoutScreens.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/LayoutScreens.o ) [15 of 21] Compiling XMonadContrib.TwoPane ( XMonadContrib/TwoPane.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/TwoPane.o ) [16 of 21] Compiling XMonadContrib.Decoration ( XMonadContrib/Decoration.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Decoration.o ) [17 of 21] Compiling XMonadContrib.Tabbed ( XMonadContrib/Tabbed.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Tabbed.o ) [18 of 21] Compiling XMonadContrib.Commands ( XMonadContrib/Commands.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/Commands.o ) [19 of 21] Compiling XMonadContrib.XMonadPrompt ( XMonadContrib/XMonadPrompt.hs, dist/build/xmonad/xmonad-tmp/XMonadContrib/XMonadPrompt.o ) [20 of 21] Compiling Config ( Config.hs, dist/build/xmonad/xmonad-tmp/Config.o )
Config.hs:1:0: Identifier `Config.workspaces' has conflicting definitions in the module and its hs-boot file Installing: /tmp/build/xmonad/usr/lib/ghc-6.6.1/site-local/ xmonad-0.3darcs & /tmp/build/xmonad/usr/bin xmonad-0.2... *** Exception: dist/build/xmonad/xmonad: copyFile: does not exist (No such file or directory)
As I am still not a haskell developer, I do not know what to change :)
Something strange is there. I get, using latest darcs X11-extrsa and xmonad: $ b Preprocessing executables for xmonad-0.2... Building xmonad-0.2... /home/dons/bin/ghc -I/usr/obj/cabal -o /usr/obj/cabal/xmonad/xmonad --make -hide-all-packages -i -i/usr/obj/cabal/autogen -i. -odir /usr/obj/cabal/xmonad/xmonad-tmp -hidir /usr/obj/cabal/xmonad/xmonad-tmp -package base-2.0 -package X11-1.2.2 -package X11-extras-0.2 -package mtl-1.0 -package unix-1.0 -funbox-strict-fields -O2 -fasm -Wall -optl-Wl,-s -fglasgow-exts Main.hs [1 of 6] Compiling StackSet ( StackSet.hs, /usr/obj/cabal/xmonad/xmonad-tmp/StackSet.o ) [2 of 6] Compiling XMonad ( XMonad.hs, /usr/obj/cabal/xmonad/xmonad-tmp/XMonad.o ) [3 of 6] Compiling Config[boot] ( Config.hs-boot, nothing ) [4 of 6] Compiling Operations ( Operations.hs, /usr/obj/cabal/xmonad/xmonad-tmp/Operations.o ) [5 of 6] Compiling Config ( Config.hs, /usr/obj/cabal/xmonad/xmonad-tmp/Config.o ) [6 of 6] Compiling Main ( Main.hs, /usr/obj/cabal/xmonad/xmonad-tmp/Main.o ) Main.hs:197:39: Warning: Defined but not used: `t' Linking /usr/obj/cabal/xmonad/xmonad ... It built fine. Could you double check with a 'runhaskell Setup.lhs clean' first? (Its not possible to commit a patch that breaks the core xmonad, afaik -- darcs won't allow that to be submitted) -- Don

On Thu, Aug 16, 2007 at 03:02:40AM +0000, Xavier Maillard wrote:
Hello,
Since my latest darcs pull, my config.hs file refuses to compile with this error: Config.hs:1:0: Identifier `Config.workspaces' has conflicting definitions in the module and its hs-boot file Installing: /tmp/build/xmonad/usr/lib/ghc-6.6.1/site-local/ xmonad-0.3darcs & /tmp/build/xmonad/usr/bin xmonad-0.2... *** Exception: dist/build/xmonad/xmonad: copyFile: does not exist (No such file or directory)
As I am still not a haskell developer, I do not know what to change :)
Config.hs changed recently. Check if you applied to correct patch to Config.hs-boot too. specifically test for the presence of a line like this: workspaces :: [WorkspaceId] if, as I suppose, you still have workspaces :: Int change it to workspaces :: [WorkspaceId] Hope this helps. Andrea

Hello,
Andrea Rossato
if, as I suppose, you still have workspaces :: Int change it to workspaces :: [WorkspaceId]
It helped but I now have this : [20 of 21] Compiling Config ( Config.hs, dist/build/xmonad/xmonad-tmp/Config.o ) Config.hs:171:30: No instance for (Integral [WorkspaceId]) arising from use of `fromIntegral' at Config.hs:171:30-52 Possible fix: add an instance declaration for (Integral [WorkspaceId]) In the first argument of `(-)', namely `fromIntegral workspaces' In the expression: (fromIntegral workspaces) - 1 In the first argument of `zip', namely `[0 .. (fromIntegral workspaces) - 1]' Thak your time and help, all. Regards, Xavier P.S: I only use darcs version with latest patches pulled (always do this)

On Thu, Aug 16, 2007 at 05:52:37AM +0000, Xavier Maillard wrote:
It helped but I now have this :
[20 of 21] Compiling Config ( Config.hs, dist/build/xmonad/xmonad-tmp/Config.o )
Config.hs:171:30: No instance for (Integral [WorkspaceId]) arising from use of `fromIntegral' at Config.hs:171:30-52 Possible fix: add an instance declaration for (Integral [WorkspaceId]) In the first argument of `(-)', namely `fromIntegral workspaces' In the expression: (fromIntegral workspaces) - 1 In the first argument of `zip', namely `[0 .. (fromIntegral workspaces) - 1]'
You are using a function that is not working after the latest changes in XMonad (take into account that the darcs version, while very stable, still is a work in progress and sometimes the Contrib modules are a bit out of sync). We have 2 ways now: 1. the best thing is to start with a new, fresh Config file: save the one you are working on and issu the darcs revert command: darcs revert Config.hs Then rewrite your personalization from scratch and see what fails. 2. send here the offending lines (arounf Config line 170), so that I can understand the specific issue with the offending function and try to give you an answer. Let me know. Andrea

Hello,
Andrea Rossato
2. send here the offending lines (arounf Config line 170), so that I can understand the specific issue with the offending function and try to give you an answer.
Here are they: -- mod-shift-[1..9] @@ Move client to workspace N [((m .|. modMask, k), f i) | (i, k) <- zip [0 .. fromIntegral workspaces - 1] [xK_1 ..] , (f, m) <- [(view, 0), (shift, shiftMask)]] Once again, thank you very much (I really should start learning haskell to be as independant as possible :)) Regards, Xavier

On Thu, Aug 16, 2007 at 07:17:12AM +0000, Xavier Maillard wrote:
-- mod-shift-[1..9] @@ Move client to workspace N [((m .|. modMask, k), f i) | (i, k) <- zip [0 .. fromIntegral workspaces - 1] [xK_1 ..] , (f, m) <- [(view, 0), (shift, shiftMask)]]
you are using a wrong version of Config.hs... BTW, this problem can be solved by changing that list to: -- mod-shift-[1..9] @@ Move client to workspace N [((m .|. modMask, k), f i) | (i, k) <- zip workspaces [xK_1 ..] , (f, m) <- [(view, 0), (shift, shiftMask)]] Andrea

Hello,
Andrea Rossato
you are using a wrong version of Config.hs...
BTW, this problem can be solved by changing that list to:
-- mod-shift-[1..9] <at> <at> Move client to workspace N [((m .|. modMask, k), f i) | (i, k) <- zip workspaces [xK_1 ..] , (f, m) <- [(view, 0), (shift, shiftMask)]]
Sorry for the delay. You are right, this has fixed my compile issue. Regards, Xavier

Hi Xavier, only as a side-note. Although I use a heavily modified Config.hs (different key bindings, lots of extensions) it's quite easy for me to sync changes in with Emacs' `ediff'. So if xmonad fails to compile the first thing I do is `ediff' between my Config.hs and the original one. Bye, Tassilo -- If programmers deserve to be rewarded for creating innovative programs, by the same token they deserve to be punished if they restrict the use of these programs. (Richard M. Stallman)

Hello Tassilo,
Tassilo Horn
only as a side-note. Although I use a heavily modified Config.hs (different key bindings, lots of extensions) it's quite easy for me to sync changes in with Emacs' `ediff'. So if xmonad fails to compile the first thing I do is `ediff' between my Config.hs and the original one.
Although I agree with you, it would not help me since I am really not a haskell programer *at all* :) I feel so lost reading haskell code that I am still asking if xmonad is really the way to go for me :/ On the other part, xmonad works very well for me and I just love it so, I keep trying :) Regards, Xavier

maillaxa:
Hello Tassilo,
Tassilo Horn
writes: only as a side-note. Although I use a heavily modified Config.hs (different key bindings, lots of extensions) it's quite easy for me to sync changes in with Emacs' `ediff'. So if xmonad fails to compile the first thing I do is `ediff' between my Config.hs and the original one.
Although I agree with you, it would not help me since I am really not a haskell programer *at all* :) I feel so lost reading haskell code that I am still asking if xmonad is really the way to go for me :/ On the other part, xmonad works very well for me and I just love it so, I keep trying :)
It is good to learn new things! You'll pick it up in no time, I'm sure :) If any of the code is hard to understand in the Config file, drop by the #xmonad @ freenode irc channel, and we can walk through it together. -- Don

On Fri, Aug 17, 2007 at 02:12:16PM +1000, Donald Bruce Stewart wrote:
It is good to learn new things!
I agree.
You'll pick it up in no time, I'm sure :)
The part that I'm having trouble with is monads and the associated operators (liftm comes to mind, it seems to be somehow related). I read Hal Daume's tutorial. Do you have advice what else I can read to grok? (And I'm having trouble to understand the relationship between "<-" and "=". Apparently, "<-" somehow implies that "statements" are "executed" in some order. But Haskell tries really hard to hide the fact that there are statements and that there is such as thing as execution. As Haskell is based on lambda calculus, I am not surprised -- there are no statements and there is no order of execution in lambda calculus. So Haskell tries so hard to hide them that I can't find them...) Kai

On Fri, Aug 17, 2007 at 10:38:12AM +0200, Kai Grossjohann wrote:
The part that I'm having trouble with is monads and the associated operators (liftm comes to mind, it seems to be somehow related). I read Hal Daume's tutorial. Do you have advice what else I can read to grok?
(And I'm having trouble to understand the relationship between "<-" and "=". Apparently, "<-" somehow implies that "statements" are "executed" in some order. But Haskell tries really hard to hide the fact that there are statements and that there is such as thing as execution. As Haskell is based on lambda calculus, I am not surprised -- there are no statements and there is no order of execution in lambda calculus. So Haskell tries so hard to hide them that I can't find them...)
Hi Kay, may I point you to this? http://www.haskell.org/haskellwiki/The_Monadic_Way I wrote it when I was trying to grasp monads myself, with the hope to provide newcomers with a helpful guide through stuff like <-, >> and
=.
A monad is just a way to nest anonymous functions so that bound variables (<-) can be later used by other (nested) anonymous functions. And by nesting functions you can simulate an order of execution. The complexity of this operation is hidden by the "do" notation, where every new line is indeed an anonymous function. The advise I can give you is to try to re-implement monads (and later arrows, and so on), by reading the papers that discovered them. For monads I suggest this paper: P. Wadler, Monads for functional programming. http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf This is how I came to understand monads. Hope this helps Andrea

On Fri, Aug 17, 2007 at 10:38:12AM +0200, Kai Grossjohann wrote:
The part that I'm having trouble with is monads and the associated operators (liftm comes to mind, it seems to be somehow related). I read Hal Daume's tutorial. Do you have advice what else I can read to grok?
(And I'm having trouble to understand the relationship between "<-" and "=". Apparently, "<-" somehow implies that "statements" are "executed" in some order.
Sort of, but only really because it gives a name to the result of a computation, which might get used later (at which point the result needs to be known, so the computation needs to have been performed). Order of execution in Haskell is _always_ ultimately decided by data dependencies - whether you're in a monad or not.
But Haskell tries really hard to hide the fact that there are statements and that there is such as thing as execution.
Well, there aren't statements really, so it doesn't have to try at all. ;-) You might possibly find useful some slides I wrote for a talk I gave locally about monads. It's not perfect or the whole story, and will surely becoming increasingly embarassing to me the more I learn (I'm already cringing at several parts) - in particular I made the classic mistake of confusing "I sort of understand the I/O monad" with "I sort of understand monads". However, it might help. It might at least help you get to grips with the difference between = and <- in do blocks (and when to use each form - see slide 15), and also liftM (slide 17). :-) http://gimbo.org.uk/blog/2007/05/14/a-pragmatic-look-at-monads-in-haskell/ HTH, -Andy -- Andy Gimblett Computer Science Department University of Wales Swansea http://www.cs.swan.ac.uk/~csandy/

tassilo:
Hi Xavier,
only as a side-note. Although I use a heavily modified Config.hs (different key bindings, lots of extensions) it's quite easy for me to sync changes in with Emacs' `ediff'. So if xmonad fails to compile the first thing I do is `ediff' between my Config.hs and the original one.
Bye, Tassilo
That's a good idea. I used to use vimdiff when diffing dwm config.h files. My Config.hs is very minimally modified, so its not so much of an issue now. -- Don
participants (6)
-
Andrea Rossato
-
Andy Gimblett
-
dons@cse.unsw.edu.au
-
Kai Grossjohann
-
Tassilo Horn
-
Xavier Maillard