Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Added a new helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanenkj@gmail.com committed Aug 21, 2008
1 parent b3e658d commit eab30a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Sound/PortAudio/Helpers.hs
Expand Up @@ -23,3 +23,9 @@ replicateWhileM mcond action = let f again = do c <- mcond
if c then liftM2 (:) action again
else return []
in fix f

-- Pulled from Mat Morrow's lambdabot code parser
untilM :: (a -> Bool) -> [a] -> Maybe a
untilM _ [] = Nothing
untilM p (x:xs) = if p x
then Just x else untilM p xs

0 comments on commit eab30a6

Please sign in to comment.