mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-31 04:01:52 -07:00
While an implementation of `liftM2 (&&)` may seem like a straightforward lift of `(&&)` into a monadic setting, it actually expands to (<&&>) :: Monad m => m Bool -> m Bool -> m Bool mb <&&> mb' = do a <- mb b <- mb' return (a && b) which runs both monadic effects first and then applies `(&&)`. This is fixed by introducing a monadic version of `if-then-else` (which is also exported due to its usefulness) that checks the second result only if this is explicitly necessary.