
Hey list, I'm in the process of splitting up my setup into something more modular within ~/.xmonad/lib - and most things were pretty straight forward with that. However, I can't seem to get my layout definition to work. The compiler flakes out like this: [snip] xmonad --recompile Error detected while loading xmonad configuration file: /home/hawk/.xmonad/xmonad.hs lib/XMonad/Config/FT/Layouts.hs:19:23: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0) arising from a use of `smartBorders' Possible fix: add an instance declaration for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0) In the expression: smartBorders In the expression: smartBorders $ fullscreenFull Full In an equation for `fullScreenNoBorders': fullScreenNoBorders = smartBorders $ fullscreenFull Full lib/XMonad/Config/FT/Layouts.hs:23:13: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier (ConfigurableBorder Ambiguity) a0) arising from a use of `onWorkspace' Possible fix: add an instance declaration for (XMonad.Layout.LayoutModifier.LayoutModifier (ConfigurableBorder Ambiguity) a0) In the expression: onWorkspace "fs" fullScreenNoBorders In the expression: onWorkspace "fs" fullScreenNoBorders $ onWorkspace "im" imLayout $ Full ||| Mirror tiled ||| tiled ||| Circle In an equation for `ftLayouts': ftLayouts = onWorkspace "fs" fullScreenNoBorders $ onWorkspace "im" imLayout $ Full ||| Mirror tiled ||| tiled ||| Circle lib/XMonad/Config/FT/Layouts.hs:24:13: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier AddRoster a0) arising from a use of `onWorkspace' Possible fix: add an instance declaration for (XMonad.Layout.LayoutModifier.LayoutModifier AddRoster a0) In the expression: onWorkspace "im" imLayout In the second argument of `($)', namely `onWorkspace "im" imLayout $ Full ||| Mirror tiled ||| tiled ||| Circle' In the expression: onWorkspace "fs" fullScreenNoBorders $ onWorkspace "im" imLayout $ Full ||| Mirror tiled ||| tiled ||| Circle lib/XMonad/Config/FT/Layouts.hs:25:45: No instance for (XMonad.Core.LayoutClass Circle a0) arising from a use of `|||' Possible fix: add an instance declaration for (XMonad.Core.LayoutClass Circle a0) In the second argument of `(|||)', namely `tiled ||| Circle' In the second argument of `(|||)', namely `Mirror tiled ||| tiled ||| Circle' In the second argument of `($)', namely `Full ||| Mirror tiled ||| tiled ||| Circle' Please check the file for errors. [snap] The offending Code looks like this: [snip] module XMonad.Config.FT.Layouts ( ftLayouts ) where import XMonad.Layout import XMonad.Layout.Circle import XMonad.Layout.Fullscreen import XMonad.Layout.Grid import XMonad.Layout.IM import XMonad.Layout.Named import XMonad.Layout.NoBorders import XMonad.Layout.PerWorkspace import XMonad.Layout.ResizableTile tiled = named "Tall" $ ResizableTall nmaster delta ratio [] where nmaster = 1 ratio = 0.67 delta = 0.03 fullScreenNoBorders = smartBorders $ fullscreenFull Full imLayout = withIM (15/100) (Role "roster") $ Grid ftLayouts = onWorkspace "fs" fullScreenNoBorders $ onWorkspace "im" imLayout $ Full ||| Mirror tiled ||| tiled ||| Circle [snap] The fun part is that this code works in my monolithic setup. Also, if I strip this down to something like: ftLayouts = Full ||| Mirror tiled ||| tiled ...plus the required definitions and imports for that, the code compiles and works. I don't know what is special about `smartBorders', `Circle' and `onWorkspace'. Maybe someone has an idea. It sure would reduce my level of frustration right now. :-) If it matters, this is with xmonad and xmonad-contrib, both from darcs (updated a few minutes ago) and: % ghc --version The Glorious Glasgow Haskell Compilation System, version 7.4.1 Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925

On Sun, Dec 30, 2012 at 4:35 PM, Frank Terbeck
lib/XMonad/Config/FT/Layouts.hs:19:23: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0) arising from a use of `smartBorders' Possible fix: add an instance declaration for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0) In the expression: smartBorders In the expression: smartBorders $ fullscreenFull Full In an equation for `fullScreenNoBorders': fullScreenNoBorders = smartBorders $ fullscreenFull Full
Why are you using Full there? There's no real point in modifying it to add the ability to switch the layout to Full when a window wants to be fullscreen; it's just a somewhat expensive way to say "smartBorders Full". (This is not, however, the problem; it should compile, it's just kinda pointless.) lib/XMonad/Config/FT/Layouts.hs:25:45:
No instance for (XMonad.Core.LayoutClass Circle a0) arising from a use of `|||'
This looks suspicious to me. Circle *is* an instance of LayoutClass... but it may be an instance of the *wrong* LayoutClass. Which is to say, you may have multiple versions of xmonad and possibly xmonad-contrib registered with ghc, and the instances are being pulled from different versions and don't match up as a result. (Normally you see this when package versions suddenly start showing up as prefixes in type or typeclass names, but there are screw cases where you can't see this... such as when it's only typeclass instances that mismatch.) Use "ghc-pkg list" to make sure there is exactly one xmonad and exactly one XMonadContrib and that they match each other. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Hello Brandon, Brandon Allbery wrote:
On Sun, Dec 30, 2012 at 4:35 PM, Frank Terbeck
wrote: [...] fullScreenNoBorders = smartBorders $ fullscreenFull Full
Why are you using Full there? There's no real point in modifying it to add the ability to switch the layout to Full when a window wants to be fullscreen; it's just a somewhat expensive way to say "smartBorders Full".
(This is not, however, the problem; it should compile, it's just kinda pointless.)
I think this was the first layout that made my fullscreen workspace work. It's quite possible, that it's not the best way to achieve it. It's not like I'm an expert with all this. :) Thanks for the suggestion, though, I'll use that in the future.
lib/XMonad/Config/FT/Layouts.hs:25:45:
No instance for (XMonad.Core.LayoutClass Circle a0) arising from a use of `|||'
This looks suspicious to me. Circle *is* an instance of LayoutClass... but it may be an instance of the *wrong* LayoutClass. Which is to say, you may have multiple versions of xmonad and possibly xmonad-contrib registered with ghc, and the instances are being pulled from different versions and don't match up as a result. (Normally you see this when package versions suddenly start showing up as prefixes in type or typeclass names, but there are screw cases where you can't see this... such as when it's only typeclass instances that mismatch.)
Hm, wouldn't this affect the monolithic setup, too though?
Use "ghc-pkg list" to make sure there is exactly one xmonad and exactly one XMonadContrib and that they match each other.
AFAICS, both packages are installed one time: % ghc-pkg list [...] xmonad-0.10.1 xmonad-contrib-0.10.1 [...] Regards, Frank

On Sun, Dec 30, 2012 at 4:35 PM, Frank Terbeck
xmonad --recompile Error detected while loading xmonad configuration file: /home/hawk/.xmonad/xmonad.hs
lib/XMonad/Config/FT/Layouts.hs:19:23: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0)
Hi Frank, All your type errors involve some type variables like `a0' above that eventually become Window when the definition is used in your config. You could try adding {-# LANGUAGE NoMonomorphismRestriction #-} to the top of lib/XMonad/Config/FT/Layouts.hs. I think that will stop ghc from trying to fix a given `a0' when compiling your Layouts.hs Another option is to add a type signature yourself that fixes the `a0' to be Window. Putting that annotation at top level is going to be very nasty since the type is going to be as big as the actual definition. Instead you could apply to your layouts a function that will restrict the type: (id :: x Window -> x Window) -- Adam

Hello Adam, adam vogt wrote:
On Sun, Dec 30, 2012 at 4:35 PM, Frank Terbeck
wrote: xmonad --recompile Error detected while loading xmonad configuration file: /home/hawk/.xmonad/xmonad.hs
lib/XMonad/Config/FT/Layouts.hs:19:23: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0) [...] All your type errors involve some type variables like `a0' above that eventually become Window when the definition is used in your config. You could try adding {-# LANGUAGE NoMonomorphismRestriction #-} to the top of lib/XMonad/Config/FT/Layouts.hs. I think that will stop ghc from trying to fix a given `a0' when compiling your Layouts.hs
This fixed it. Thanks a lot! :-) Regards, Frank

On Sun, Dec 30, 2012 at 05:32:29PM -0500, adam vogt wrote:
On Sun, Dec 30, 2012 at 4:35 PM, Frank Terbeck
wrote: xmonad --recompile Error detected while loading xmonad configuration file: /home/hawk/.xmonad/xmonad.hs
lib/XMonad/Config/FT/Layouts.hs:19:23: No instance for (XMonad.Layout.LayoutModifier.LayoutModifier FullscreenFull a0)
Hi Frank,
All your type errors involve some type variables like `a0' above that eventually become Window when the definition is used in your config. You could try adding {-# LANGUAGE NoMonomorphismRestriction #-} to the top of lib/XMonad/Config/FT/Layouts.hs. I think that will stop ghc from trying to fix a given `a0' when compiling your Layouts.hs
I just want to point out that this also explains why it worked in the monolithic version but not when breaking your config up into separate modules. In the monolithic version, GHC was able to correctly infer that a0 must be Window because of how your layout was used. When the layout is on its own in a module, GHC does not have enough information to figure out the type. -Brent
participants (4)
-
adam vogt
-
Brandon Allbery
-
Brent Yorgey
-
Frank Terbeck