mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-06 23:11:54 -07:00
X.C.Prime: add ifThenElse binding
This is necessary for if-then-else support in the user's config.
This commit is contained in:
@@ -87,6 +87,7 @@ module Prelude,
|
|||||||
-- Regular people shouldn't need to know about these.
|
-- Regular people shouldn't need to know about these.
|
||||||
Prime,
|
Prime,
|
||||||
(>>),
|
(>>),
|
||||||
|
ifThenElse,
|
||||||
|
|
||||||
-- * Example config
|
-- * Example config
|
||||||
-- $example
|
-- $example
|
||||||
@@ -138,6 +139,12 @@ type Prime l l' = XConfig l -> IO (XConfig l')
|
|||||||
(>>) :: Prime l l' -> Prime l' l'' -> Prime l l''
|
(>>) :: Prime l l' -> Prime l' l'' -> Prime l l''
|
||||||
(>>) x y c = (P.>>=) (x c) y
|
(>>) 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
|
-- | 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
|
-- default 'XConfig') into your do-block, takes the modified config out of your
|
||||||
-- do-block, and then runs xmonad.
|
-- do-block, and then runs xmonad.
|
||||||
|
Reference in New Issue
Block a user