supermonad-0.2.0.1: Plugin and base library to support supermonads in Haskell

Safe HaskellNone
LanguageHaskell2010

Control.Super.Monad.MonadPlus

Description

WARNING: This module is an experiment to see how MonadPlus may be encoded. The authors are not aware of any generalized monads that make use of MonadPlus. Hence, we do not know if this encoding of it is sufficient. Therefore, the encoding is not in its final form and may change in the future.

Synopsis

Documentation

class AlternativeEmpty m => MonadPlusZero m where Source #

The encoding of the mzero operation.

Return is not a superclass, because the indices or constraints involved in an MonadPlusZero instance may differ from those involved with the Return instance.

WARNING: This module is an experiment to see how MonadPlus may be encoded. The authors are not aware of any generalized applicatives that make use of MonadPlus. Hence, we do not know if this encoding of it is sufficient. Therefore, the encoding is not in its final form and may change in the future.

Minimal complete definition

mzero

Associated Types

type MonadPlusZeroCts m :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts m => m a Source #

Instances

MonadPlusZero [] Source # 

Associated Types

type MonadPlusZeroCts ([] :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts [] => [a] Source #

MonadPlusZero Maybe Source # 

Associated Types

type MonadPlusZeroCts (Maybe :: * -> *) :: Constraint Source #

MonadPlusZero IO Source # 

Associated Types

type MonadPlusZeroCts (IO :: * -> *) :: Constraint Source #

MonadPlusZero Option Source # 

Associated Types

type MonadPlusZeroCts (Option :: * -> *) :: Constraint Source #

MonadPlusZero STM Source # 

Associated Types

type MonadPlusZeroCts (STM :: * -> *) :: Constraint Source #

MonadPlusZero ReadPrec Source # 

Associated Types

type MonadPlusZeroCts (ReadPrec :: * -> *) :: Constraint Source #

MonadPlusZero ReadP Source # 

Associated Types

type MonadPlusZeroCts (ReadP :: * -> *) :: Constraint Source #

MonadPlusZero (U1 *) Source # 

Associated Types

type MonadPlusZeroCts (U1 * :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts (U1 *) => U1 * a Source #

MonadPlusZero (Proxy *) Source # 

Associated Types

type MonadPlusZeroCts (Proxy * :: * -> *) :: Constraint Source #

MonadPlusZero f => MonadPlusZero (Rec1 * f) Source # 

Associated Types

type MonadPlusZeroCts (Rec1 * f :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts (Rec1 * f) => Rec1 * f a Source #

MonadPlusZero f => MonadPlusZero (Alt * f) Source # 

Associated Types

type MonadPlusZeroCts (Alt * f :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts (Alt * f) => Alt * f a Source #

(MonadPlusZero f, MonadPlusZero g) => MonadPlusZero ((:*:) * f g) Source # 

Associated Types

type MonadPlusZeroCts ((* :*: f) g :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts ((* :*: f) g) => (* :*: f) g a Source #

(MonadPlusZero f, MonadPlusZero f') => MonadPlusZero (Product * f f') Source # 

Associated Types

type MonadPlusZeroCts (Product * f f' :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts (Product * f f') => Product * f f' a Source #

MonadPlusZero f => MonadPlusZero (M1 * i c f) Source # 

Associated Types

type MonadPlusZeroCts (M1 * i c f :: * -> *) :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts (M1 * i c f) => M1 * i c f a Source #

class AlternativeAlt f g h => MonadPlusAdd f g h where Source #

The encoding of the mplus operation.

Bind is not a superclass, because the indices or constraints involved in an MonadPlusAdd instance may differ from those involved with the Bind instance.

WARNING: This module is an experiment to see how MonadPlus may be encoded. The authors are not aware of any generalized applicatives that make use of MonadPlus. Hence, we do not know if this encoding of it is sufficient. Therefore, the encoding is not in its final form and may change in the future.

Minimal complete definition

mplus

Associated Types

type MonadPlusAddCts f g h :: Constraint Source #

Methods

mplus :: MonadPlusAddCts f g h => f a -> g a -> h a Source #

Instances

MonadPlusAdd [] [] [] Source # 

Associated Types

type MonadPlusAddCts ([] :: * -> *) ([] :: * -> *) ([] :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts [] [] [] => [a] -> [a] -> [a] Source #

MonadPlusAdd Maybe Maybe Maybe Source # 

Associated Types

type MonadPlusAddCts (Maybe :: * -> *) (Maybe :: * -> *) (Maybe :: * -> *) :: Constraint Source #

MonadPlusAdd IO IO IO Source # 

Associated Types

type MonadPlusAddCts (IO :: * -> *) (IO :: * -> *) (IO :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts IO IO IO => IO a -> IO a -> IO a Source #

MonadPlusAdd Option Option Option Source # 

Associated Types

type MonadPlusAddCts (Option :: * -> *) (Option :: * -> *) (Option :: * -> *) :: Constraint Source #

MonadPlusAdd STM STM STM Source # 

Associated Types

type MonadPlusAddCts (STM :: * -> *) (STM :: * -> *) (STM :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts STM STM STM => STM a -> STM a -> STM a Source #

MonadPlusAdd ReadPrec ReadPrec ReadPrec Source # 

Associated Types

type MonadPlusAddCts (ReadPrec :: * -> *) (ReadPrec :: * -> *) (ReadPrec :: * -> *) :: Constraint Source #

MonadPlusAdd ReadP ReadP ReadP Source # 

Associated Types

type MonadPlusAddCts (ReadP :: * -> *) (ReadP :: * -> *) (ReadP :: * -> *) :: Constraint Source #

MonadPlusAdd (U1 *) (U1 *) (U1 *) Source # 

Associated Types

type MonadPlusAddCts (U1 * :: * -> *) (U1 * :: * -> *) (U1 * :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (U1 *) (U1 *) (U1 *) => U1 * a -> U1 * a -> U1 * a Source #

MonadPlusAdd (Proxy *) (Proxy *) (Proxy *) Source # 

Associated Types

type MonadPlusAddCts (Proxy * :: * -> *) (Proxy * :: * -> *) (Proxy * :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Proxy *) (Proxy *) (Proxy *) => Proxy * a -> Proxy * a -> Proxy * a Source #

MonadPlusAdd f g h => MonadPlusAdd (Rec1 * f) (Rec1 * g) (Rec1 * h) Source # 

Associated Types

type MonadPlusAddCts (Rec1 * f :: * -> *) (Rec1 * g :: * -> *) (Rec1 * h :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Rec1 * f) (Rec1 * g) (Rec1 * h) => Rec1 * f a -> Rec1 * g a -> Rec1 * h a Source #

MonadPlusAdd f g h => MonadPlusAdd (Alt * f) (Alt * g) (Alt * h) Source # 

Associated Types

type MonadPlusAddCts (Alt * f :: * -> *) (Alt * g :: * -> *) (Alt * h :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Alt * f) (Alt * g) (Alt * h) => Alt * f a -> Alt * g a -> Alt * h a Source #

(MonadPlusAdd f g h, MonadPlusAdd f' g' h') => MonadPlusAdd ((:*:) * f f') ((:*:) * g g') ((:*:) * h h') Source # 

Associated Types

type MonadPlusAddCts ((* :*: f) f' :: * -> *) ((* :*: g) g' :: * -> *) ((* :*: h) h' :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts ((* :*: f) f') ((* :*: g) g') ((* :*: h) h') => (* :*: f) f' a -> (* :*: g) g' a -> (* :*: h) h' a Source #

(MonadPlusAdd f g h, MonadPlusAdd f' g' h') => MonadPlusAdd (Product * f f') (Product * g g') (Product * h h') Source # 

Associated Types

type MonadPlusAddCts (Product * f f' :: * -> *) (Product * g g' :: * -> *) (Product * h h' :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Product * f f') (Product * g g') (Product * h h') => Product * f f' a -> Product * g g' a -> Product * h h' a Source #

MonadPlusAdd f g h => MonadPlusAdd (M1 * i c f) (M1 * i c g) (M1 * i c h) Source # 

Associated Types

type MonadPlusAddCts (M1 * i c f :: * -> *) (M1 * i c g :: * -> *) (M1 * i c h :: * -> *) :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (M1 * i c f) (M1 * i c g) (M1 * i c h) => M1 * i c f a -> M1 * i c g a -> M1 * i c h a Source #