summaryrefslogtreecommitdiffstats
path: root/src/Control/Monad/Extended.hs
blob: d91b12c7fe6deb2e9db93ecfccace903d8c82d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Control.Monad.Extended
    ( module Control.Monad
    , unlessM_
    , untilM_
    ) where

import Control.Monad


unlessM_ :: Monad m => m Bool -> m () -> m ()
unlessM_ p f = p >>= flip unless f

untilM_ :: Monad m => m Bool -> m a -> m ()
untilM_ p f = unlessM_ p (f >> untilM_ p f)