[xmonad] Config File Format
Devin Mullins
me at twifkak.com
Thu May 15 04:52:31 EDT 2008
On Thu, May 15, 2008 at 01:20:08AM -0400, Gwern Branwen wrote:
> For example, why do we have all these repeated <:>? If monads are
> 'programmable semicolons', surely we could get rid of them. :)
That is an interesting option. (I wasn't being that clever.) However, a
(non-programmer) beginner probably won't ask "why are there repeated
semicolons?", but rather tell himself, "oh, I use semicolons to
configure xmonad". This could, of course, teach a bad habit. :)
> Another thing: when I cast myself into a beginner's mind, I see no
> reason that modMask and terminal use '<=>', but layout and layoutHook
> must use '<+>'. All look like they're updating a variable.
Again, try to imagine you're not a programmer, and hence don't know what
'updating a variable' is. :)
The distinction I was trying to draw (and perhaps failing at) was that
<-> removes something <=> sets something, and <+> adds something. Not
every thing supports every operation. For example, you can add and
remove keybindings (or set the whole list from scratch), but can only
add new layout choices, or set the list from scratch (since our types
won't allow removal).
> So I worry that this approach might lead to too much 'magic' and mysteriousness.
Fair point.
> The current config file at least is discoverable: once you learn
> haskell syntax, you can then consult the haddocks and find out
> everything you need to know, and why everything is the way it is.
Is learning basic Haskell syntax and semantics too much to ask new
users? This is a genuine question; I'm not sure what xmonad's "mission
statement" is, here. :P
> And
> if you already know Haskell, then it's just a matter of learning some
> libraries, something you do all the time.
I think if you know Haskell, you'll be okay with the higher-order
functions that it employs.
> But a list of variable updates, that can be just a mess.
But that's what it is now. When we write:
layoutHook = smartBorders (layoutHook defaultConfig ||| simpleTabbed)
the result is equivalent, just in mixed order (middle-to-right-to-left),
whereas
main = xmonad =<< do
addTo layouts simpleTabbed
addTo layoutHooks smartBorders
All happens from top-to-bottom order.
(There's your monadic syntax. :)
> * Actually, would anyone lynch me if I did something like go through
> XMC and remove all the $s from the examples and docs?
Hrm... not off-hand, no. I was going to whine re: UrgencyHook docs, but
then my reasons for the dollar there are more aesthetic than anything. :P
Thanks for your thoughts. I will chew. I hope you will, too.
More information about the xmonad
mailing list