[xmonad] Re: darcs patch: Allow users to choose whether the tabbar should always...

David Roundy droundy at darcs.net
Mon Apr 14 10:34:59 EDT 2008

On Mon, Apr 14, 2008 at 02:06:57PM +0000, Ivan Miljenovic wrote:
> > I see no reason to define createTabs or createTabsAlways.
> Maybe not, I just liked the extra level of abstraction.  This way, the 
> booleans are only ever used twice, rather than addTabs{,Bottom}{,Always} 
> all having to mention it.

A nicer way to acheive more readable code is to replace the Bool with a
custom data type:

data TabHowOften = AlwaysTabs | TabsWhenPlural

Then your code is easier to read and you don't need to define these

> > And shouldn't the former function be tabMaker False?
> Ummmmm..... yes ;-)

This, for instance, would have been more obvious with the above approach.
I prefer to never use Bool when I could avoid it.  It's too easy to forget
(or for a reader to be forced to read the code to determine) which meaning
"True" indicates.

> Still not sure of the "always" name ending, but couldn't think of anything 
> better at the time.

I'm not sure either.  Always isn't too bad.
David Roundy
Department of Physics
Oregon State University

More information about the xmonad mailing list