[Xmonad] Constrained dynamically extensible layout events: a patch

David Roundy droundy at darcs.net
Fri May 4 10:10:30 EDT 2007


On Fri, May 04, 2007 at 06:07:52PM +1000, Donald Bruce Stewart wrote:
> dons:
> > David, Spencer et al, are there any problems with restricting layoutMsg
> > arguments to being members of the (open) Message class? I'd (strongly)
> > prefer this over just Dynamic, since it restores most of the static
> > checking we'd need. 
> 
> Oh, I forgot an example. This is why Dynamic-only is scary:
> 
>         , ((modMask,               xK_h     ), layoutMsg "hey Joe!")
>         , ((modMask,               xK_l     ), layoutMsg Expand)
> 
> is well typed. Under the new system, it becomes a static error:
> 
>     Config.hs:157:43:
>         No instance for (Message [Char])
>               arising from use of `sendMessage' at Config.hs:157:43-65

I personally like the ability to send unaccepted messages.  It can't pose a
problem on the receiving end, since every layout has to be able to handle
messages it knows nothing about.  So the only danger is foolish users who
send messages that have no effect, but that really seems harmless to me.  I
guess getting better error checking is nice, but it seems like you're
talking about error checking for something that really isn't likely to be a
problem.

This is different from the NonEmpty list issue, which still is working on
avoiding the dangers of foolish users--who define an empty layout list--but
in that case those foolish users could actually crash xmonad, rather than
simply defining a key binding that has no effect.
-- 
David Roundy
http://www.darcs.net


More information about the Xmonad mailing list