From d7afdbd26d58a149520b1ab56730b7e348f95db3 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 21 Nov 2007 11:46:13 +0100 Subject: Add 'and' and 'or' functions to ManageHook. darcs-hash:20071121104613-a5988-0c0355da9fc8e8d5482b9a36565c646a11ea92e7 --- XMonad/ManageHook.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'XMonad') 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) -- cgit v1.2.3