is there a way to build xmonad-contrib 0.9.2 on a system with ghc 7.4.1?

Hi I would like to install xmonad 0.9.2 (which worked fine for me) on my Ubuntu 12.04 system (GHC 7.4.1). Following the instructions on README, xmonad-0.9.2 compiles fine but xmonad-contrib-0.9.2 fails at the build stage: [101 of 180] Compiling XMonad.Layout.MouseResizableTile ( XMonad/Layout/MouseResizableTile.hs, dist/build/XMonad/Layout/MouseResizableTile.o ) XMonad/Layout/MouseResizableTile.hs:182:17: Could not deduce (Eq t) arising from the literal `0' from the context (Num t) bound by the type signature for replaceAtPos :: Num t => [Rational] -> t -> Rational -> [Rational] at XMonad/Layout/MouseResizableTile.hs:(182,1)-(185,61) Possible fix: add (Eq t) to the context of the type signature for replaceAtPos :: Num t => [Rational] -> t -> Rational -> [Rational] In the pattern: 0 In an equation for `replaceAtPos': replaceAtPos [] 0 x' = [x'] cabal: Error: some packages failed to install: xmonad-contrib-0.9.2 failed during the building phase. The exception was: ExitFailure 1 Is there a way to get this to build on my system? thank you for any help ~l

On Thu, Jun 28, 2012 at 2:11 PM, Lara Michaels
I would like to install xmonad 0.9.2 (which worked fine for me) on my Ubuntu 12.04 system (GHC 7.4.1).
If you're having problems with 0.10, perhaps we should be examining the diffs between the two to see what changed and why. (Although "why" isn't always explained; not all programmers comment or document as well as they should.)
XMonad/Layout/MouseResizableTile.hs:182:17: Could not deduce (Eq t) arising from the literal `0' from the context (Num t) bound by the type signature for replaceAtPos :: Num t => [Rational] -> t -> Rational -> [Rational] at XMonad/Layout/MouseResizableTile.hs:(182,1)-(185,61) Possible fix: add (Eq t) to the context of
It's telling you exactly how to fix it. Num used to imply Eq and Show, but no longer does; as such, those constraints may need to be added in some places where pre-7.2 compiled things without error. In this case we don't need Show but do need Eq. cabal unpack xmonad-contrib-0.9.2 vi -n +182 XMonad/Layout/MouseResizableTile.c # or use your favorite editor to change "Num t =>" to "(Num t, Eq t) =>" cabal install # no package name here; it will build and install the package in the current directory -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

Thank you for your help with this, too. Now I get another error in a different file where simply appending Eq b' doesn't do the trick: [170 of 180] Compiling XMonad.Actions.GridSelect ( XMonad/Actions/GridSelect.hs, dist/build/XMonad/Actions/GridSelect.o ) XMonad/Actions/GridSelect.hs:227:12: Could not deduce (Eq b') arising from a use of `nub' from the context (Enum b', Num b') bound by the type signature for diamondLayer :: (Enum b', Num b') => b' -> [(b', b')] at XMonad/Actions/GridSelect.hs:(226,1)-(229,35) Possible fix: add (Eq b') to the context of the type signature for diamondLayer :: (Enum b', Num b') => b' -> [(b', b')] In the expression: nub In the expression: nub $ ul ++ (map (negate *** id) ul) ++ (map (negate *** negate) ul) ++ (map (id *** negate) ul) In the expression: let ul = [... | x <- ...] in nub $ ul ++ (map (negate *** id) ul) ++ (map (negate *** negate) ul) ++ (map (id *** negate) ul) Following your earlier advice, I have tried replacing the line diamondLayer :: (Enum b', Num b') => b' -> [(b', b')] with both diamondLayer :: (Enum b', Num b', Eq b') => b' -> [(b', b')] as well as diamondLayer :: (Enum b', (Num b', Eq b')) => b' -> [(b', b')] but the compiler was unhappy about it in both occasions.

On Thu, Jun 28, 2012 at 3:27 PM, Lara Michaels
Following your earlier advice, I have tried replacing the line
diamondLayer :: (Enum b', Num b') => b' -> [(b', b')]
with both
diamondLayer :: (Enum b', Num b', Eq b') => b' -> [(b', b')]
This one is correct; you also need to add it to the definition of diamond on line 231, or the error will move there. (I *think* that is sufficient, but it may be necessary to track down other places where the constraint must be added, as the compiler reports them.) -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (2)
-
Brandon Allbery
-
Lara Michaels