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

Safe HaskellNone
LanguageHaskell2010

Control.Super.Monad.Constrained.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 a :: Constraint Source #

Methods

mzero :: MonadPlusZeroCts m a => m a Source #

Instances

MonadPlusZero [] Source # 

Associated Types

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

Methods

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

MonadPlusZero Maybe Source # 

Associated Types

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

MonadPlusZero IO Source # 

Associated Types

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

Methods

mzero :: MonadPlusZeroCts IO a => IO a Source #

MonadPlusZero Option Source # 

Associated Types

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

MonadPlusZero STM Source # 

Associated Types

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

MonadPlusZero ReadPrec Source # 

Associated Types

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

MonadPlusZero ReadP Source # 

Associated Types

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

MonadPlusZero (U1 *) Source # 

Associated Types

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

Methods

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

MonadPlusZero (Proxy *) Source # 

Associated Types

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

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

Associated Types

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

Methods

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

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

Associated Types

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

Methods

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

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

Associated Types

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

Methods

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

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

Associated Types

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

Methods

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

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

Associated Types

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

Methods

mzero :: MonadPlusZeroCts (M1 * i c f) a => 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 a :: Constraint Source #

Methods

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

Instances

MonadPlusAdd [] [] [] Source # 

Associated Types

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

Methods

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

MonadPlusAdd Maybe Maybe Maybe Source # 

Associated Types

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

MonadPlusAdd IO IO IO Source # 

Associated Types

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

Methods

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

MonadPlusAdd Option Option Option Source # 

Associated Types

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

MonadPlusAdd STM STM STM Source # 

Associated Types

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

Methods

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

MonadPlusAdd ReadPrec ReadPrec ReadPrec Source # 

Associated Types

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

MonadPlusAdd ReadP ReadP ReadP Source # 

Associated Types

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

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

Associated Types

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

Methods

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

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

Associated Types

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

Methods

mplus :: MonadPlusAddCts (Proxy *) (Proxy *) (Proxy *) a => 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 :: * -> *) a :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Rec1 * f) (Rec1 * g) (Rec1 * h) a => 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 :: * -> *) a :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Alt * f) (Alt * g) (Alt * h) a => 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' :: * -> *) a :: Constraint Source #

Methods

mplus :: MonadPlusAddCts ((* :*: f) f') ((* :*: g) g') ((* :*: h) h') a => (* :*: 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' :: * -> *) a :: Constraint Source #

Methods

mplus :: MonadPlusAddCts (Product * f f') (Product * g g') (Product * h h') a => 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 :: * -> *) a :: Constraint Source #

Methods

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