aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Mullins <devinmullins@gmail.com>2014-09-24 21:15:09 +0200
committerDevin Mullins <devinmullins@gmail.com>2014-09-24 21:15:09 +0200
commit2fe61ecb2ec4bff0ae9422a4814c136b6e63790a (patch)
treeebe7efd3c20c7024065bd5cb8fc69f60191e70ce
parent644eea8a960ec70d3147e88a43ef1a82d2fb7c17 (diff)
downloadXMonadContrib-2fe61ecb2ec4bff0ae9422a4814c136b6e63790a.tar.gz
XMonadContrib-2fe61ecb2ec4bff0ae9422a4814c136b6e63790a.tar.xz
XMonadContrib-2fe61ecb2ec4bff0ae9422a4814c136b6e63790a.zip
X.C.Prime: add ifThenElse binding
Ignore-this: ae775c418c27301b9c12d2a233502cec This is necessary for if-then-else support in the user's config. darcs-hash:20140924191509-c7120-7e3ce81753c191843eb74426292db3af31197abe.gz
-rw-r--r--XMonad/Config/Prime.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/XMonad/Config/Prime.hs b/XMonad/Config/Prime.hs
index 04f1985..2a617f5 100644
--- a/XMonad/Config/Prime.hs
+++ b/XMonad/Config/Prime.hs
@@ -87,6 +87,7 @@ module Prelude,
-- Regular people shouldn't need to know about these.
Prime,
(>>),
+ifThenElse,
-- * Example config
-- $example
@@ -138,6 +139,12 @@ type Prime l l' = XConfig l -> IO (XConfig l')
(>>) :: Prime l l' -> Prime l' l'' -> Prime l l''
(>>) x y c = (P.>>=) (x c) y
+-- | Because of RebindableSyntax, this is necessary to enable you to use
+-- if-then-else expressions. No need to call it directly.
+ifThenElse :: Bool -> a -> a -> a
+ifThenElse True a _ = a
+ifThenElse False _ b = b
+
-- | This is the xmonad main function. It passes 'XMonad.Config.def' (the
-- default 'XConfig') into your do-block, takes the modified config out of your
-- do-block, and then runs xmonad.