This commit is contained in:
Joey Hess 2011-12-03 09:10:23 -04:00
parent b5930f6d07
commit 64672c6262
5 changed files with 6 additions and 12 deletions

View file

@ -9,12 +9,6 @@ module Utility.Conditional where
import Control.Monad (when, unless)
untilTrue :: Monad m => [v] -> (v -> m Bool) -> m Bool
untilTrue [] _ = return False
untilTrue (v:vs) a = do
ok <- a v
if ok then return ok else untilTrue vs a
whenM :: Monad m => m Bool -> m () -> m ()
whenM c a = c >>= flip when a