Files
xmonad/src
slotThe d92125485a X.ManageHook: Make (<&&>) and (<||>) lazy in their second argument
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.
2021-10-16 16:33:04 +02:00
..
2014-05-02 17:51:59 +00:00