|
@@ -1,3 +1,6 @@
|
|
|
|
+{-# LANGUAGE ExistentialQuantification #-}
|
|
|
|
+{-# LANGUAGE KindSignatures #-}
|
|
|
|
+
|
|
module Control.Monad.Extras (
|
|
module Control.Monad.Extras (
|
|
ifM,
|
|
ifM,
|
|
unlessM,
|
|
unlessM,
|
|
@@ -8,9 +11,6 @@ module Control.Monad.Extras (
|
|
import Control.Monad
|
|
import Control.Monad
|
|
import Control.Applicative
|
|
import Control.Applicative
|
|
|
|
|
|
-ifThenElse :: Bool -> a -> a -> a
|
|
|
|
-ifThenElse i t e = if i then t else e
|
|
|
|
-
|
|
|
|
-- | A version of if with monadic test.
|
|
-- | A version of if with monadic test.
|
|
ifM :: Monad m => m Bool -> m a -> m a -> m a
|
|
ifM :: Monad m => m Bool -> m a -> m a -> m a
|
|
ifM i t e = do
|
|
ifM i t e = do
|