[xmonad] Use regexps for className matching?

Wirt Wolff wirtwolff at gmail.com
Mon Feb 9 11:38:00 EST 2009


Excerpts from Henri Ducrocq's message of Mon Feb 09 06:41:41 -0700 2009:
> For example
>   className =? "Google Mail"  --> doShift "1"
>   className =? "Google Calendar"  --> doShift "1"

can become:

import Data.List

    -- skipped
    fmap ("Google" `isPrefixOf`) className --> doShift "1"

Also from Data.List are isSuffixOf and isInfixOf if you need those.

> "bc" `isInfixOf` "abcdef" 
True

> "bc" `isInfixOf` "bcdef" && "bc" `isInfixOf` "abc"
True
-- 
wmw


More information about the xmonad mailing list