From f00e2cc920b6df8e81fff0072b99b2eeac0b3e3c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 25 Nov 2016 18:41:16 -0800 Subject: [PATCH] [XMonad] Add toggle functions (needed for previous rewrites) --- dotfiles/xmonad/xmonad.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 03d982d1..1938510e 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -88,6 +88,14 @@ if' False _ y = y ifL :: a -> a -> Bool -> a ifL a b c = if' c a b + +toggleInMap' d k m = + let existingValue = M.findWithDefault d k m + in (M.insert k (not existingValue) m) + +toggleInMap = toggleInMap' True + +maybeRemap k = M.findWithDefault k k -- Selectors