summaryrefslogtreecommitdiffstats
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
commitd7afdbd26d58a149520b1ab56730b7e348f95db3 (patch)
tree2e42d1c97be982b36ec219ff3db72cb049271bbc
parent3f95bf2fe7206a5816a79216d33efcff2a4979b3 (diff)
downloadmetatile-d7afdbd26d58a149520b1ab56730b7e348f95db3.tar
metatile-d7afdbd26d58a149520b1ab56730b7e348f95db3.zip
Add 'and' and 'or' functions to ManageHook.
darcs-hash:20071121104613-a5988-0c0355da9fc8e8d5482b9a36565c646a11ea92e7
-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)