[Xmonad] Notes on xmonad

Simon Peyton-Jones simonpj at microsoft.com
Thu Jul 5 11:42:15 EDT 2007

Here are some note I jotted down as I was working on the xmonad code.

* allocaXEvent/nextEvent/getEvent sequence is too ugly to appear in
  Main!  You can hide the EventPtr structure in the XMonad, and
  allocate it in runX.

* When you resize the xnest window, the new size isn't reported to xmonad.
  Instead, the xmonad window is truncated.  Turns out to be xnest's fault.

* Ugly Stack vs StackOrNot.  This should be hidden inside StackSet.
  The only place it's used is in runLayout.

  Likewise there should be only one exported integrate, not
  integrate and integrate'

* 'modify' is defined in Control.Monad.State and in StackSet -- very confusing.
  Furthermore, although modify, modify' are exported from StackSet,
  they are never used (and probably should not be exported, so as
  to preserve the abstaction).

* In StackSet.findIndex, use integrate rather than reimplementing it

* In StackSet.new, the Nothing should be emptyStack, with a suitable
  defn for emptyStack

* In Operations, line 171, Stack should be abstract!  use 'focus' to extract
  the focus.  Ditto line 372

* StackSet.focus is not the same as Operations.focus.  Unhelpful!

* I respecfully suggest that this code (Operations.hs) is impenetrable
    tiled = (W.stack . W.workspace . W.current $ this)
            >>= W.filter (not . flip M.member (W.floating ws))

* In the call to restackWindows in Operations.hs, why bring the
  focused window to the front of the list?  Needs a comment at least.

More information about the Xmonad mailing list