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

@ -24,3 +24,7 @@ firstM p (x:xs) = do
- stopping once one is found. -}
anyM :: (Monad m) => (a -> m Bool) -> [a] -> m Bool
anyM p = liftM isJust . firstM p
{- Runs an action on values from a list until it succeeds. -}
untilTrue :: (Monad m) => [a] -> (a -> m Bool) -> m Bool
untilTrue = flip anyM