Mask supporting modules

This commit is contained in:
Stephen Diehl
2017-01-02 12:06:37 +00:00
parent 03f5746e96
commit 3994639b2b
5 changed files with 10 additions and 10 deletions
+1
View File
@@ -22,6 +22,7 @@ hush :: Alternative m => Either e a -> m a
hush (Left _) = empty
hush (Right x) = pure x
-- To suppress redundenet applicative constraint warning on GHC 8.0
#if ( __GLASGOW_HASKELL__ >= 800 )
note :: (MonadError e m) => e -> Maybe a -> m a
note err = maybe (throwError err) pure
+1 -1
View File
@@ -12,7 +12,7 @@ module Functor (
import Data.Function ((.))
#if (__GLASGOW_HASKELL__ >= 710)
#if MIN_VERSION_base(4,7,0)
import Data.Functor (
Functor(..)
, ($>)
+2 -5
View File
@@ -42,12 +42,7 @@ module Monad (
import Base (seq)
import Data.List (concat)
#if (__GLASGOW_HASKELL__ >= 710)
import Control.Monad hiding ((<$!>))
#else
import Control.Monad
#endif
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
concatMapM f xs = liftM concat (mapM f xs)
@@ -64,9 +59,11 @@ liftM2' f a b = do
z `seq` return z
{-# INLINE liftM2' #-}
#if !MIN_VERSION_base(4,8,0)
(<$!>) :: Monad m => (a -> b) -> m a -> m b
f <$!> m = do
x <- m
let z = f x
z `seq` return z
{-# INLINE (<$!>) #-}
#endif