diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-03 09:10:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-03 09:10:23 -0400 |
commit | 64672c6262048e9498be667f8dc7460c0a9189e2 (patch) | |
tree | 194453dc8731dff8207bbc76bc752ad472c1f795 /Utility/Monad.hs | |
parent | b5930f6d076d266b337b415447f448fbb14d9ea3 (diff) |
refactor
Diffstat (limited to 'Utility/Monad.hs')
-rw-r--r-- | Utility/Monad.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Utility/Monad.hs b/Utility/Monad.hs index 9523e1716..0d1675fa4 100644 --- a/Utility/Monad.hs +++ b/Utility/Monad.hs @@ -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 |