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

Safe HaskellNone
LanguageHaskell2010

Control.Super.Monad.Alternative

Description

WARNING: This module is an experiment to see how Alternative may be encoded. The authors are not aware of any generalized applicatives that make use of Alternative. 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 Functor f => AlternativeEmpty f where Source #

The encoding of the empty operation.

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

WARNING: This module is an experiment to see how Alternative may be encoded. The authors are not aware of any generalized applicatives that make use of Alternative. 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

empty

Associated Types

type AlternativeEmptyCts f :: Constraint Source #

Methods

empty :: AlternativeEmptyCts f => f a Source #

Instances

AlternativeEmpty [] Source # 

Associated Types

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

Methods

empty :: AlternativeEmptyCts [] => [a] Source #

AlternativeEmpty Maybe Source # 

Associated Types

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

AlternativeEmpty IO Source # 

Associated Types

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

AlternativeEmpty Option Source # 

Associated Types

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

AlternativeEmpty STM Source # 

Associated Types

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

AlternativeEmpty ReadPrec Source # 
AlternativeEmpty ReadP Source # 

Associated Types

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

AlternativeEmpty (U1 *) Source # 

Associated Types

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

AlternativeEmpty (Proxy *) Source # 

Associated Types

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

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

Associated Types

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

Methods

empty :: AlternativeEmptyCts (Rec1 * f) => Rec1 * f a Source #

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

Associated Types

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

Methods

empty :: AlternativeEmptyCts (Alt * f) => Alt * f a Source #

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

Associated Types

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

Methods

empty :: AlternativeEmptyCts ((* :*: f) g) => (* :*: f) g a Source #

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

Associated Types

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

Methods

empty :: AlternativeEmptyCts (Product * f f') => Product * f f' a Source #

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

Associated Types

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

Methods

empty :: AlternativeEmptyCts (M1 * i c f) => M1 * i c f a Source #

(AlternativeEmpty f, AlternativeEmpty g) => AlternativeEmpty ((:.:) * * f g) Source # 

Associated Types

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

Methods

empty :: AlternativeEmptyCts ((* :.: *) f g) => (* :.: *) f g a Source #

(AlternativeEmpty f, AlternativeEmpty f') => AlternativeEmpty (Compose * * f f') Source # 

Associated Types

type AlternativeEmptyCts (Compose * * f f' :: * -> *) :: Constraint Source #

Methods

empty :: AlternativeEmptyCts (Compose * * f f') => Compose * * f f' a Source #

class (Functor f, Functor g, Functor h) => AlternativeAlt f g h where Source #

The encoding of the <|> operation.

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

WARNING: This module is an experiment to see how Alternative may be encoded. The authors are not aware of any generalized applicatives that make use of Alternative. 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

(<|>)

Associated Types

type AlternativeAltCts f g h :: Constraint Source #

Methods

(<|>) :: AlternativeAltCts f g h => f a -> g a -> h a Source #

Instances

AlternativeAlt [] [] [] Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts [] [] [] => [a] -> [a] -> [a] Source #

AlternativeAlt Maybe Maybe Maybe Source # 

Associated Types

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

AlternativeAlt IO IO IO Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts IO IO IO => IO a -> IO a -> IO a Source #

AlternativeAlt Option Option Option Source # 

Associated Types

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

AlternativeAlt STM STM STM Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts STM STM STM => STM a -> STM a -> STM a Source #

AlternativeAlt ReadPrec ReadPrec ReadPrec Source # 

Associated Types

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

AlternativeAlt ReadP ReadP ReadP Source # 

Associated Types

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

AlternativeAlt (U1 *) (U1 *) (U1 *) Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (U1 *) (U1 *) (U1 *) => U1 * a -> U1 * a -> U1 * a Source #

AlternativeAlt (Proxy *) (Proxy *) (Proxy *) Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (Proxy *) (Proxy *) (Proxy *) => Proxy * a -> Proxy * a -> Proxy * a Source #

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

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (Rec1 * f) (Rec1 * g) (Rec1 * h) => Rec1 * f a -> Rec1 * g a -> Rec1 * h a Source #

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

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (Alt * f) (Alt * g) (Alt * h) => Alt * f a -> Alt * g a -> Alt * h a Source #

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

Associated Types

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

Methods

(<|>) :: AlternativeAltCts ((* :*: f) f') ((* :*: g) g') ((* :*: h) h') => (* :*: f) f' a -> (* :*: g) g' a -> (* :*: h) h' a Source #

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

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (Product * f f') (Product * g g') (Product * h h') => Product * f f' a -> Product * g g' a -> Product * h h' a Source #

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

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (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 #

(Applicative f g h, AlternativeAlt f' g' h') => AlternativeAlt ((:.:) * * f f') ((:.:) * * g g') ((:.:) * * h h') Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts ((* :.: *) f f') ((* :.: *) g g') ((* :.: *) h h') => (* :.: *) f f' a -> (* :.: *) g g' a -> (* :.: *) h h' a Source #

(Applicative f g h, AlternativeAlt f' g' h') => AlternativeAlt (Compose * * f f') (Compose * * g g') (Compose * * h h') Source # 

Associated Types

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

Methods

(<|>) :: AlternativeAltCts (Compose * * f f') (Compose * * g g') (Compose * * h h') => Compose * * f f' a -> Compose * * g g' a -> Compose * * h h' a Source #