[xmonad] How to organize myLayoutHook?

Daniel Trstenjak daniel.trstenjak at gmail.com
Wed Oct 17 08:11:46 CEST 2012


Hi David,

On Tue, Oct 16, 2012 at 07:38:22PM -0700, Jeffrey David Johnson wrote:
> Most parts of my xmonad.hs have reasonably simple types:
> 
> myXPConfig :: XPConfig
> myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
> myManageHook :: ManageHook
> myLogHook :: Handle -> X ()
> myWorkspaces :: [WorkspaceId]
> etc.
> 
> But myLayoutHook is uniquely complicated. Here's the current version:
> ...

Partly it seems to be because of the Choose type in 'xmonad/XMonad/Layout.hs',
which is used in a recursive manner to combine the layouts (|||).

I think it's done this way to be able to combine different layout types,
which all have an instance of LayoutClass, without needing existential
quantification.

By using existential quantification it might be possible to represent
the combined layouts by just a list, and the current layout could
be indicated by a lens.

Or I'm missing something regarding the Choose type?


Greetings,
Daniel



More information about the xmonad mailing list