
On Sun, Feb 17, 2013 at 7:30 AM, Carsten Mattner
xmonad built fine with GHC HEAD but XMonadContrib failed with the following build error:
XMonad/Layout/MultiToggle.hs:162:9: Could not deduce (HList b w0) arising from the ambiguity check for `??' from the context (HList b w) bound by the type signature for ?? :: HList b w => a -> b -> HCons a b at XMonad/Layout/MultiToggle.hs:162:9-42 The type variable `w0' is ambiguous In the ambiguity check for: forall a b w. HList b w => a -> b -> HCons a b In the type signature for `??': ?? :: HList b w => a -> b -> HCons a b
Can anyone suggest a fix?
Hi Carsten, You could remove that context completely: (??) :: a -> b -> HCons a b Unfortunately, this makes it possible to construct HLists that might be invalid for the rest of the code. For example with the context there I have: :t \a b -> a ?? b ?? () <interactive>:1:16: No instance for (HList () w0) arising from a use of `??' Possible fix: add an instance declaration for (HList () w0) In the second argument of `(??)', namely `b ?? ()' In the expression: a ?? b ?? () In the expression: \ a b -> a ?? b ?? () With my suggested change, you are allowed to end the list with () \a b -> a ?? b ?? () :: a -> a1 -> HCons a (HCons a1 ()) Other things to try, that probably won't work, is to try something that might make ghc be more lazy about finding the instance: (??) :: (b2 ~ b, HList b2 w) => a -> b -> HCons a b Also, you might also try adding a fundep to the HList class, which will fix the 'w' given the 'b'. class HList c a | c -> a where -- Adam