The following function executes each action from the list until a predicate returns
True. I have a feeling that this function can be rewritten using
fold and without the
do construct but I don't know how.
execUntil :: (Eq a, Monad m) => [m a] -> (a -> Bool) -> m () execUntil  p = return () execUntil (a:as) p = do r <- a if p r then return () else execUntil as p