refactor
This commit is contained in:
parent
b5930f6d07
commit
64672c6262
5 changed files with 6 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue