[Xmonad] more minor code comments on StackSet.hs

David Roundy droundy at darcs.net
Tue Aug 7 20:14:10 EDT 2007


On Tue, Aug 07, 2007 at 04:57:30PM -0700, Michael Vanier wrote:
> Other comments:
> 
> -- I find the way that Screen wraps a workspace somewhat icky, though I 
> can't think of a better alternative.  It feels like it compromises the 
> symmetry of the StackSet data structure.  Maybe I'm just being too picky 
> here.

Agreed, it's very ugly.  More symmetric options don't seem to be very
popular, thought.  It seems to me that the "right" way to do things is to use
hierarchical Stacks of one sort or another, and handle the arranging of
workspaces on screens in a manner symmetrical to the handling of windows on
workspaces (and in a Layout like Combo, or when there are float windows
forming a sub-workspace, the handling of sub-workspaces within
workspaces).

It seems best to me to have a single data structure which is used to
describe "a set of things, one of which has focus."  Currently, we've got
two: StackSet describes a set of Screens, one of which has focus, and Stack
describes a set of Windows, one of which has focus.  StackSet also
describes a set of Workspaces, one of which has focus implicitly, via the
mapping between Screens and Workspaces.

> -- Why do we need the StackOrNot type alias?  What's wrong with Maybe 
> (Stack a)?  IMO the latter is more readable, or more readable when you use 
> Maybe monad functions.

It's my fault, and in retrospect it wasn't such a hot idea.  My thought was
that StackOrNot would indicate that Nothing doesn't indicate an error, just
that there are no windows present.  I wouldn't object to a patch removing
StackOrNot.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the Xmonad mailing list