From 24d095cad7969a7bdadd1fa05c4742f4d66033e6 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Jan 2019 19:59:11 +0100 Subject: Reaktor.Plugins.System.hWithLines: use untilM_ --- src/Control/Monad/Extended.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Control/Monad/Extended.hs (limited to 'src/Control/Monad') diff --git a/src/Control/Monad/Extended.hs b/src/Control/Monad/Extended.hs new file mode 100644 index 0000000..d91b12c --- /dev/null +++ b/src/Control/Monad/Extended.hs @@ -0,0 +1,14 @@ +module Control.Monad.Extended + ( module Control.Monad + , unlessM_ + , untilM_ + ) where + +import Control.Monad + + +unlessM_ :: Monad m => m Bool -> m () -> m () +unlessM_ p f = p >>= flip unless f + +untilM_ :: Monad m => m Bool -> m a -> m () +untilM_ p f = unlessM_ p (f >> untilM_ p f) -- cgit v1.2.3