
On Wed, Mar 24, 2010 at 02:53:36AM -0400, wagnerdm@seas.upenn.edu wrote:
Quoting Adam Vogt
: I don't quite understand how -fwarn-overlapping-patterns can be used to avoid overlapping keybinds: you suggest replacing the (Map Key (X ())) with a function (Key -> Maybe (X ())) (with the maybe possibly added by catching pattern match failures)? Performance probably doesn't matter here, but I believe pattern matches are tried one after the other, as compared to Data.Map which is a bit smarter than that.
Something like that, yes, though changing the interface to core functionality has historically been a hard sell. Rather, I would suggest writing keybindings as a function, then reifying the function as a Data.Map in the configuration value both for backwards-compatibility and (as you say) for performance reasons. This shouldn't be too hard, assuming there's a reasonably short range of possible keys, which seems pretty likely.
~d
KeySym is a 29 bit value, and you've also got to consider modifiers. Functions are not workable unless you can accept extending xmonad's startup time by several hours. Cheers, Spencer Janssen