darcs patch: hide existential Layout (mostly) from user API.

Hi all,
This allows us to eliminate the wart of requiring a Layout wrapper around
our layoutHook. Besides being ugly, this wrapper hampers the composability
of layouts: we can't simply write something like:
myconfig = defaultConfig { layoutHook = Layout $ Mirror $ layoutHook defaultConfig }
because there's no Read instance for Layout Window, so Mirror (Layout Window) has no
Read instance. Obviously, we could get rid of this with an unLayout higher-order function,
but I see no reason to expose our users to this at all.
David
Sat Nov 10 16:30:55 PST 2007 David Roundy

On Sat, Nov 10, 2007 at 04:34:21PM -0800, David Roundy wrote:
This allows us to eliminate the wart of requiring a Layout wrapper around our layoutHook. Besides being ugly, this wrapper hampers the composability of layouts: we can't simply write something like:
myconfig = defaultConfig { layoutHook = Layout $ Mirror $ layoutHook defaultConfig }
I think this is the huge win here. Not only does it allow the above; it also allows us to write more config "combinators". In particular (until we have eventHooks), I could move withUrgencyHook to the the outer level: main = xmonad $ withUrgencyHook defaultConfig { yada yada } and it could modify the layoutHook and logHook in one go. Another might be WindowNavigation, which could add the layout hook and default keybindings at the same time. Devin

On Sun, Nov 11, 2007 at 03:14:51PM -0500, Devin Mullins wrote:
Another might be WindowNavigation, which could add the layout hook and default keybindings at the same time.
Hmmm. Interesting idea... but I'm not sure that folks use the default keybindings. Do they? I really wish we had a popularity-contest sort of module to allow users to automatically vote for their prefered layouts/keybindings/etc. This addition would definitely make sense if most WindowNavigation users used the default keybindings, but I keep wondering if we'd be better off hijacking hjkl for this (at least for vi users). I'm not sure where I'd move the existing jk bindings, except that mod-jk is naturally (to me) mod-tab and mod-shift-tab. -- David Roundy Department of Physics Oregon State University

On Mon, Nov 12, 2007 at 06:41:35AM -0800, David Roundy wrote:
On Sun, Nov 11, 2007 at 03:14:51PM -0500, Devin Mullins wrote:
Another might be WindowNavigation, which could add the layout hook and default keybindings at the same time.
Hmmm. Interesting idea... but I'm not sure that folks use the default keybindings. Do they?
Yeah, good point, I use WASD. I suppose it could take (up,left,down,right) as a parameter.
I really wish we had a popularity-contest sort of module to allow users to automatically vote for their prefered layouts/keybindings/etc. Interesting... I mean, I suppose encouraging people to post their configs on the wiki is a start. You're talking a contrib that xmessages you if you'd like to post your config, and if so, does it for you? Or you could just set up a web survey... or just ask the list. ;)

On Mon, Nov 12, 2007 at 12:05:44PM -0500, Devin Mullins wrote:
On Mon, Nov 12, 2007 at 06:41:35AM -0800, David Roundy wrote:
On Sun, Nov 11, 2007 at 03:14:51PM -0500, Devin Mullins wrote:
Another might be WindowNavigation, which could add the layout hook and default keybindings at the same time.
Hmmm. Interesting idea... but I'm not sure that folks use the default keybindings. Do they?
Yeah, good point, I use WASD. I suppose it could take (up,left,down,right) as a parameter.
Yeah, but then what about the modifier keys? Perhaps we could have several functions to do this, but soon it starts getting rather hairy, and maybe it'd just be easier for users to do on their own. Also, note that users can copy one of the provided configs to get some sort of "reasonable" default keybindings as a starting point. (Mine are a little crazy, though...)
I really wish we had a popularity-contest sort of module to allow users to automatically vote for their prefered layouts/keybindings/etc.
Interesting... I mean, I suppose encouraging people to post their configs on the wiki is a start. You're talking a contrib that xmessages you if you'd like to post your config, and if so, does it for you? Or you could just set up a web survey... or just ask the list. ;)
I'm thinking more like a config that sends email to a fixed email address indicating what your config is. Obviously not installed by default, but for those who would like their configs to be considered in development decisions. Probably with no privacy at all, just because it's easiest. Ideally, this would be done with some sort of automated tracking of statistics, so we could easily see what fraction of (voting) users use Tabbed, NoBorders, SmartBorders, etc. But it's definitely not worth my time to write this... and may not be worth anyone's time. -- David Roundy Department of Physics Oregon State University

On Saturday 10 November 2007 18:34:21 David Roundy wrote:
Hi all,
This allows us to eliminate the wart of requiring a Layout wrapper around our layoutHook. Besides being ugly, this wrapper hampers the composability of layouts: we can't simply write something like:
myconfig = defaultConfig { layoutHook = Layout $ Mirror $ layoutHook defaultConfig }
because there's no Read instance for Layout Window, so Mirror (Layout Window) has no Read instance. Obviously, we could get rid of this with an unLayout higher-order function, but I see no reason to expose our users to this at all.
David
Sat Nov 10 16:30:55 PST 2007 David Roundy
* hide existential Layout (mostly) from user API.
Applied.
participants (3)
-
David Roundy
-
Devin Mullins
-
Spencer Janssen