aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-11-21 11:46:13 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-11-21 11:46:13 +0100
commit0acd4706b39b5f726068213c1fd50f5444f2cfcb (patch)
tree2e42d1c97be982b36ec219ff3db72cb049271bbc /XMonad
parent336f2b4d6154b3cefcf7e6fa82940c223fc3d6bc (diff)
downloadxmonad-0acd4706b39b5f726068213c1fd50f5444f2cfcb.tar.gz
xmonad-0acd4706b39b5f726068213c1fd50f5444f2cfcb.tar.xz
xmonad-0acd4706b39b5f726068213c1fd50f5444f2cfcb.zip
Add 'and' and 'or' functions to ManageHook.
darcs-hash:20071121104613-a5988-0c0355da9fc8e8d5482b9a36565c646a11ea92e7.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/ManageHook.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/XMonad/ManageHook.hs b/XMonad/ManageHook.hs
index e48a9b5..8fb61ee 100644
--- a/XMonad/ManageHook.hs
+++ b/XMonad/ManageHook.hs
@@ -49,6 +49,16 @@ p --> f = p >>= \b -> if b then f else mempty
(=?) :: Eq a => Query a -> a -> Query Bool
q =? x = fmap (== x) q
+infixr 3 <&&>, <||>
+
+-- | 'p <&&> q'. '&&' lifted to a Monad.
+(<&&>) :: Monad m => m Bool -> m Bool -> m Bool
+(<&&>) = liftM2 (&&)
+
+-- | 'p <||> q'. '||' lifted to a Monad.
+(<||>) :: Monad m => m Bool -> m Bool -> m Bool
+(<||>) = liftM2 (||)
+
-- | Queries that return the window title, resource, or class.
title, resource, className :: Query String
title = ask >>= (\w -> liftX $ withDisplay $ \d -> fmap (fromMaybe "") $ io $ fetchName d w)