darcs patch: Applicative instance for X; new startupHook

Hi all,
Here are two patches to the core, one to add an Applicative instance for X,
and another which adds a startupHook :: X () to the config. I wrote them to
support updates to PerWorkspace (patch to follow shortly), but I think
they're both useful in and of themselves, especially the startupHook.
Mon Feb 4 14:24:45 EST 2008 Brent Yorgey

byorgey:
Hi all,
Here are two patches to the core, one to add an Applicative instance for X, and another which adds a startupHook :: X () to the config. I wrote them to support updates to PerWorkspace (patch to follow shortly), but I think they're both useful in and of themselves, especially the startupHook.
Can we derive the Applicative instance? (Are applicatives in mtl yet?)

On Mon, Feb 4, 2008 at 2:42 PM, Don Stewart
byorgey:
Hi all,
Here are two patches to the core, one to add an Applicative instance for X, and another which adds a startupHook :: X () to the config. I wrote them to support updates to PerWorkspace (patch to follow shortly), but I think they're both useful in and of themselves, especially the startupHook.
Can we derive the Applicative instance? (Are applicatives in mtl yet?)
Good question: I tried, and it doesn't work. =(

This looks good. How does the startuphook differ from running code in main? It's easier for extensions to register hooks? byorgey:
Hi all,
Here are two patches to the core, one to add an Applicative instance for X, and another which adds a startupHook :: X () to the config. I wrote them to support updates to PerWorkspace (patch to follow shortly), but I think they're both useful in and of themselves, especially the startupHook.
Mon Feb 4 14:24:45 EST 2008 Brent Yorgey <[1]byorgey@gmail.com> * Add a startupHook. The only thing I am not sure about here is at what exact point the startupHook should get run. I picked a place that seems to make sense: as late as possible, right before entering the main loop. That way all the layouts/workspaces/other state are set up and the startupHook can manipulate them.
Mon Feb 4 14:23:48 EST 2008 Brent Yorgey <[2]byorgey@gmail.com> * Core.hs: add an Applicative instance for X
References
Visible links 1. mailto:byorgey@gmail.com 2. mailto:byorgey@gmail.com
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Sun, Feb 24, 2008 at 2:17 PM, Don Stewart
This looks good. How does the startuphook differ from running code in main? It's easier for extensions to register hooks?
Well, the main reason is that this way, the startupHook can be run in the X monad, AFTER xmonad has initialized all its state and so forth. Running code in main would only be able to run in IO. -Brent

byorgey:
On Sun, Feb 24, 2008 at 2:17 PM, Don Stewart <[1]dons@galois.com> wrote:
This looks good. How does the startuphook differ from running code in main? It's easier for extensions to register hooks?
Well, the main reason is that this way, the startupHook can be run in the X monad, AFTER xmonad has initialized all its state and so forth. Running code in main would only be able to run in IO.
Ah yes, good point. This is in now. Did you have contrib patches to follow?

On Sun, Feb 24, 2008 at 2:57 PM, Don Stewart
On Sun, Feb 24, 2008 at 2:17 PM, Don Stewart <[1]dons@galois.com> wrote:
This looks good. How does the startuphook differ from running code in main? It's easier for extensions to register hooks?
Well, the main reason is that this way, the startupHook can be run in
byorgey: the
X monad, AFTER xmonad has initialized all its state and so forth. Running code in main would only be able to run in IO.
Ah yes, good point. This is in now. Did you have contrib patches to follow?
We just talked about this on IRC, but for the benefit of others following the conversation -- it depends on the decision with regards to Andrea's recent patch to the core, to incorporate runLayout into the LayoutClass. If that is accepted, then we'll use his (much better) reimplementation of PerWorkspace, to make it work with xinerama. Otherwise, I have a (not quite as nice, but workable) patch to make PerWorkspace work using the startupHook. -Brent

byorgey:
Hi all,
Here are two patches to the core, one to add an Applicative instance for X, and another which adds a startupHook :: X () to the config. I wrote them to support updates to PerWorkspace (patch to follow shortly), but I think they're both useful in and of themselves, especially the startupHook.
Mon Feb 4 14:24:45 EST 2008 Brent Yorgey <[1]byorgey@gmail.com> * Add a startupHook. The only thing I am not sure about here is at what exact point the startupHook should get run. I picked a place that seems to make sense: as late as possible, right before entering the main loop. That way all the layouts/workspaces/other state are set up and the startupHook can manipulate them.
Mon Feb 4 14:23:48 EST 2008 Brent Yorgey <[2]byorgey@gmail.com> * Core.hs: add an Applicative instance for X
I've applied this. -- Don
participants (2)
-
Brent Yorgey
-
Don Stewart