[Xmonad] patch: StackSet.hs edits

Don Stewart dons at galois.com
Mon Oct 22 17:46:30 EDT 2007


byorgey:
>    Hi all,
> 
>    I've begun going through the xmonad code carefully, in order to understand
>    how it works, be able to contribute more, etc.  Today I went through
>    StackSet.hs.  While I was going through I made a bunch of small changes
>    (mostly documentation changes).  The only code changes I made were (1)
>    changing a gratuitous 'return' to 'Just'; (2) renaming 'findIndex' to
>    'findTag'.  The second may be controversial; I don't know what the policy
>    is on changing the names of functions exported by the core, but to me
>    'findTag' says *much* more clearly what the function does. 
> 
>    I have also attached a patch for XMonadContrib which changes findIndex to
>    findTag in the only contrib module which uses it, Dzen.hs.  Obviously this
>    patch should only be applied if the corresponding patch for core is made.
> 


Some comments are attached:


    [StackSet.hs: (peek): why use return when you just mean Just?  it
    will just confuse the n00bs and return to haunt you later.  Brent
    Yorgey <byorgey at gmail.com>**20071022190732] {
    hunk ./StackSet.hs 314
    -peek = with Nothing (return . focus)
    +peek = with Nothing (Just . focus)
    }

I used return . focus here because it reads nicely :)
After all, peek returns focus..

-- Don


More information about the Xmonad mailing list