Control.Monad.Compat

base-compat-batteries-0.12.2: base-compat with extra batteries

Safe Haskell | Safe-Inferred
Language | Haskell2010

Control.Monad.Compat

# Documentation

class Applicative m => Monad (m :: Type -> Type) where #

Minimal complete definition

(>>=)

Methods

(>>=) :: m a -> (a -> m b) -> m b #

(>>) :: m a -> m b -> m b #

return :: a -> m a #

#### Instances

Instances details

Monad Complex |
Instance details Defined in Data.Complex Methods (>>=) :: Complex a -> (a -> Complex b) -> Complex b # (>>) :: Complex a -> Complex b -> Complex b # return :: a -> Complex a #
Monad Identity |
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b # (>>) :: Identity a -> Identity b -> Identity b # return :: a -> Identity a #
Monad First |
Instance details Defined in Data.Monoid Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a #
Monad Last |
Instance details Defined in Data.Monoid Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a #
Monad First |
Instance details Defined in Data.Semigroup Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a #
Monad Last |
Instance details Defined in Data.Semigroup Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a #
Monad Max |
Instance details Defined in Data.Semigroup Methods (>>=) :: Max a -> (a -> Max b) -> Max b # (>>) :: Max a -> Max b -> Max b # return :: a -> Max a #
Monad Min |
Instance details Defined in Data.Semigroup Methods (>>=) :: Min a -> (a -> Min b) -> Min b # (>>) :: Min a -> Min b -> Min b # return :: a -> Min a #
Monad Dual |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Dual a -> (a -> Dual b) -> Dual b # (>>) :: Dual a -> Dual b -> Dual b # return :: a -> Dual a #
Monad Product |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Product a -> (a -> Product b) -> Product b # (>>) :: Product a -> Product b -> Product b # return :: a -> Product a #
Monad Sum |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Sum a -> (a -> Sum b) -> Sum b # (>>) :: Sum a -> Sum b -> Sum b # return :: a -> Sum a #
Monad STM |
Instance details Defined in GHC.Conc.Sync Methods (>>=) :: STM a -> (a -> STM b) -> STM b # (>>) :: STM a -> STM b -> STM b # return :: a -> STM a #
Monad P |
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: P a -> (a -> P b) -> P b # (>>) :: P a -> P b -> P b # return :: a -> P a #
Monad ReadP |
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b # (>>) :: ReadP a -> ReadP b -> ReadP b # return :: a -> ReadP a #
Monad ReadPrec |
Instance details Defined in Text.ParserCombinators.ReadPrec Methods (>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b # (>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # return :: a -> ReadPrec a #
Monad IO |
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b # (>>) :: IO a -> IO b -> IO b # return :: a -> IO a #
Monad NonEmpty |
Instance details Defined in GHC.Base Methods (>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b # (>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # return :: a -> NonEmpty a #
Monad Maybe |
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b # (>>) :: Maybe a -> Maybe b -> Maybe b # return :: a -> Maybe a #
Monad Solo |
Instance details Defined in GHC.Base Methods (>>=) :: Solo a -> (a -> Solo b) -> Solo b # (>>) :: Solo a -> Solo b -> Solo b # return :: a -> Solo a #
Monad [] |
Instance details Defined in GHC.Base Methods (>>=) :: [a] -> (a -> [b]) -> [b] # (>>) :: [a] -> [b] -> [b] # return :: a -> [a] #
Monad (Either e) |
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b # (>>) :: Either e a -> Either e b -> Either e b # return :: a -> Either e a #
Monad (Proxy :: Type -> Type) |
Instance details Defined in Data.Proxy Methods (>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b # (>>) :: Proxy a -> Proxy b -> Proxy b # return :: a -> Proxy a #
Monoid a => Monad ((,) a) |
Instance details Defined in GHC.Base Methods (>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) # (>>) :: (a, a0) -> (a, b) -> (a, b) # return :: a0 -> (a, a0) #
Monad f => Monad (Ap f) |
Instance details Defined in Data.Monoid Methods (>>=) :: Ap f a -> (a -> Ap f b) -> Ap f b # (>>) :: Ap f a -> Ap f b -> Ap f b # return :: a -> Ap f a #
Monad f => Monad (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b # (>>) :: Alt f a -> Alt f b -> Alt f b # return :: a -> Alt f a #
(Monoid a, Monoid b) => Monad ((,,) a b) |
Instance details Defined in GHC.Base Methods (>>=) :: (a, b, a0) -> (a0 -> (a, b, b0)) -> (a, b, b0) # (>>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) # return :: a0 -> (a, b, a0) #
(Monad f, Monad g) => Monad (Product f g) |
Instance details Defined in Data.Functor.Product Methods (>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b # (>>) :: Product f g a -> Product f g b -> Product f g b # return :: a -> Product f g a #
(Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c) |
Instance details Defined in GHC.Base Methods (>>=) :: (a, b, c, a0) -> (a0 -> (a, b, c, b0)) -> (a, b, c, b0) # (>>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) # return :: a0 -> (a, b, c, a0) #
Monad ((->) r) |
Instance details Defined in GHC.Base Methods (>>=) :: (r -> a) -> (a -> r -> b) -> r -> b # (>>) :: (r -> a) -> (r -> b) -> r -> b # return :: a -> r -> a #

class Functor (f :: Type -> Type) where #

Minimal complete definition

fmap

Methods

fmap :: (a -> b) -> f a -> f b #

(<$) :: a -> f b -> f a #

#### Instances

Instances details

Functor Handler |
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #
Functor Complex |
Instance details Defined in Data.Complex Methods fmap :: (a -> b) -> Complex a -> Complex b # (<$) :: a -> Complex b -> Complex a #
Functor Identity |
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b # (<$) :: a -> Identity b -> Identity a #
Functor First |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor First |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Last |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor Max |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b # (<$) :: a -> Max b -> Max a #
Functor Min |
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b # (<$) :: a -> Min b -> Min a #
Functor Dual |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b # (<$) :: a -> Dual b -> Dual a #
Functor Product |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b # (<$) :: a -> Product b -> Product a #
Functor Sum |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b # (<$) :: a -> Sum b -> Sum a #
Functor STM |
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b # (<$) :: a -> STM b -> STM a #
Functor P |
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> P a -> P b # (<$) :: a -> P b -> P a #
Functor ReadP |
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b # (<$) :: a -> ReadP b -> ReadP a #
Functor ReadPrec |
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b # (<$) :: a -> ReadPrec b -> ReadPrec a #
Functor IO |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
Functor NonEmpty |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b # (<$) :: a -> NonEmpty b -> NonEmpty a #
Functor Maybe |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
Functor Solo |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Solo a -> Solo b # (<$) :: a -> Solo b -> Solo a #
Functor [] |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> [a] -> [b] # (<$) :: a -> [b] -> [a] #
Functor (Either a) |
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
Functor (Proxy :: Type -> Type) |
Instance details Defined in Data.Proxy Methods fmap :: (a -> b) -> Proxy a -> Proxy b # (<$) :: a -> Proxy b -> Proxy a #
Functor (Arg a) |
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b # (<$) :: a0 -> Arg a b -> Arg a a0 #
Functor ((,) a) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b) -> (a, a0) -> (a, b) # (<$) :: a0 -> (a, b) -> (a, a0) #
Functor (Const m :: Type -> Type) |
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Functor f => Functor (Ap f) |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Ap f a -> Ap f b # (<$) :: a -> Ap f b -> Ap f a #
Functor f => Functor (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b # (<$) :: a -> Alt f b -> Alt f a #
Functor ((,,) a b) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, a0) -> (a, b, b0) # (<$) :: a0 -> (a, b, b0) -> (a, b, a0) #
(Functor f, Functor g) => Functor (Product f g) |
Instance details Defined in Data.Functor.Product Methods fmap :: (a -> b) -> Product f g a -> Product f g b # (<$) :: a -> Product f g b -> Product f g a #
(Functor f, Functor g) => Functor (Sum f g) |
Instance details Defined in Data.Functor.Sum Methods fmap :: (a -> b) -> Sum f g a -> Sum f g b # (<$) :: a -> Sum f g b -> Sum f g a #
Functor ((,,,) a b c) |
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) # (<$) :: a0 -> (a, b, c, b0) -> (a, b, c, a0) #
Functor ((->) r) |
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> (r -> a) -> r -> b # (<$) :: a -> (r -> b) -> r -> a #
(Functor f, Functor g) => Functor (Compose f g) |
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b # (<$) :: a -> Compose f g b -> Compose f g a #

class Monad m => MonadFail (m :: Type -> Type) #

Minimal complete definition

fail

#### Instances

Instances details

MonadFail P |
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> P a #
MonadFail ReadP |
Instance details Defined in Text.ParserCombinators.ReadP Methods fail :: String -> ReadP a #
MonadFail ReadPrec |
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fail :: String -> ReadPrec a #
MonadFail IO |
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a #
MonadFail Maybe |
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a #
MonadFail [] |
Instance details Defined in Control.Monad.Fail Methods fail :: String -> [a] #
MonadFail f => MonadFail (Ap f) |
Instance details Defined in Data.Monoid Methods fail :: String -> Ap f a #

class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where #

Minimal complete definition

Nothing

Methods

mzero :: m a #

mplus :: m a -> m a -> m a #

#### Instances

Instances details

MonadPlus STM |
Instance details Defined in GHC.Conc.Sync Methods mzero :: STM a # mplus :: STM a -> STM a -> STM a #
MonadPlus P |
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: P a # mplus :: P a -> P a -> P a #
MonadPlus ReadP |
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: ReadP a # mplus :: ReadP a -> ReadP a -> ReadP a #
MonadPlus ReadPrec |
Instance details Defined in Text.ParserCombinators.ReadPrec Methods mzero :: ReadPrec a # mplus :: ReadPrec a -> ReadPrec a -> ReadPrec a #
MonadPlus IO |
Instance details Defined in GHC.Base Methods mzero :: IO a # mplus :: IO a -> IO a -> IO a #
MonadPlus Maybe |
Instance details Defined in GHC.Base Methods mzero :: Maybe a # mplus :: Maybe a -> Maybe a -> Maybe a #
MonadPlus [] |
Instance details Defined in GHC.Base Methods mzero :: [a] # mplus :: [a] -> [a] -> [a] #
MonadPlus (Proxy :: Type -> Type) |
Instance details Defined in Data.Proxy Methods mzero :: Proxy a # mplus :: Proxy a -> Proxy a -> Proxy a #
MonadPlus f => MonadPlus (Ap f) |
Instance details Defined in Data.Monoid Methods mzero :: Ap f a # mplus :: Ap f a -> Ap f a -> Ap f a #
MonadPlus f => MonadPlus (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods mzero :: Alt f a # mplus :: Alt f a -> Alt f a -> Alt f a #
(MonadPlus f, MonadPlus g) => MonadPlus (Product f g) |
Instance details Defined in Data.Functor.Product Methods mzero :: Product f g a # mplus :: Product f g a -> Product f g a -> Product f g a #

guard :: Alternative f => Bool -> f () #

join :: Monad m => m (m a) -> m a #

(=<<) :: Monad m => (a -> m b) -> m a -> m b #

ap :: Monad m => m (a -> b) -> m a -> m b #

liftM :: Monad m => (a1 -> r) -> m a1 -> m r #

liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r #

liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r #

liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r #

liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r #

when :: Applicative f => Bool -> f () -> f () #

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) #

sequence :: (Traversable t, Monad m) => t (m a) -> m (t a) #

(<$!>) :: Monad m => (a -> b) -> m a -> m b #

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c #

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c #

filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #

foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b #

foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m () #

forever :: Applicative f => f a -> f b #

mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) #

mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a #

replicateM :: Applicative m => Int -> m a -> m [a] #

replicateM_ :: Applicative m => Int -> m a -> m () #

unless :: Applicative f => Bool -> f () -> f () #

zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #

zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () #

msum :: (Foldable t, MonadPlus m) => t (m a) -> m a #

void :: Functor f => f a -> f () #

forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b) #

fail :: MonadFail m => String -> m a #