[Xmonad] darcs patch: add NewSelect layout combinator.

David Roundy droundy at darcs.net
Mon Oct 29 13:29:14 EDT 2007

On Wed, Oct 24, 2007 at 08:32:36AM -0700, David Roundy wrote:
> Note that the code in here is pretty ugly.  Beautifications would
> be welcome.  It's just the first thing that came to my mind.  This
> is a function that ought to go into core, if it's a good idea.  And
> if it's not a good idea, it ought to be scrapped.  I really like the
> idea of eliminating all the supid "ReadableLayout" stuff needed to
> handle existentials.  So although this code is rather verbose and
> more than a little ugly, consider that it would be replacing some
> already-existing ugly code.  It would also greatly beautify the Config
> file, by eliminating both layouts and serialisedLayouts.  I'd then
> vote for renaming layoutHook to simply layout.
> David
> Wed Oct 24 11:26:48 EDT 2007  David Roundy <droundy at darcs.net>
>   * add NewSelect layout combinator.
>   This patch adds a selection layout combinator ||| which
>   replaces Select, and makes the Layout data type unnecessary.
>   This combinator isn't yet feature-complete, as I didn't implement
>   backwards rotation (PrevLayout), but that's obviously doable.  This
>   patch requires the descriptions function be added to LayoutClass in
>   core.

I'd really appreciate it if sjanssen and/or dons could take a look at this,
to see if it's worth adding descriptions to the core.  I think this is much
nicer than Select.  The code's a bit longer than Select (which should be
improvable), but it doesn't require existentials, so it'd get rid of all
the ugliness we go through to deal with that.

This needn't replace Select just yet, but can't go into XMC until we've got
the descriptions method in LayoutClass.  The descriptions patch adds just
three LOC (plus comments), and is also useful for other purposes
(e.g. using XPrompt to select layouts).  This latter use could be done
assuming a static set of layouts, but it's more robust to query the actual
set of layouts.
David Roundy
Department of Physics
Oregon State University

More information about the Xmonad mailing list