Mask supporting modules
This commit is contained in:
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user