continue-0.1.0: Control

MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone

Control.Continue

Contents

Description

Proxy to the various modules of the continue package.

Synopsis

Continue modules

Convenience reexports

class Functor f => Alt f where

Laws:

 <!> is associative:             (a <!> b) <!> c = a <!> (b <!> c)
 <$> left-distributes over <!>:  f <$> (a <!> b) = (f <$> a) <!> (f <$> b)

If extended to an Alternative then <!> should equal <|>.

Ideally, an instance of Alt also satisfies the "left distributon" law of MonadPlus with respect to .:

 <.> right-distributes over <!>: (a <!> b) <.> c = (a <.> c) <!> (b <.> c)

But Maybe, IO, Either a, ErrorT e m, and STM satisfy the alternative "left catch" law instead:

 pure a <!> b = pure a

However, this variation cannot be stated purely in terms of the dependencies of Alt.

When and if MonadPlus is successfully refactored, this class should also be refactored to remove these instances.

The right distributive law should extend in the cases where the a Bind or Monad is provided to yield variations of the right distributive law:

 (m <!> n) >>- f = (m >>- f) <!> (m >>- f)
 (m <!> n) >>= f = (m >>= f) <!> (m >>= f)

Methods

(<!>) :: f a -> f a -> f a

(|) without a required empty

some :: Applicative f => f a -> f [a]

many :: Applicative f => f a -> f [a]

Instances

Alt [] 
Alt IO

This instance does not actually satisfy the (.) right distributive law It instead satisfies the Left-Catch law

Alt Maybe 
Alt Seq 
Alt IntMap 
Alt Option 
Alt NonEmpty 
Alt (Either a) 
MonadPlus m => Alt (WrappedMonad m) 
Ord k => Alt (Map k) 
Apply f => Alt (ListT f) 
Alternative f => Alt (WrappedApplicative f) 
(Bind f, Monad f) => Alt (MaybeT f) 
Alt f => Alt (IdentityT f) 
ArrowPlus a => Alt (WrappedArrow a b) 
(Bind f, Monad f) => Alt (ErrorT e f) 
Alt f => Alt (ReaderT e f) 
Alt f => Alt (StateT e f) 
Alt f => Alt (StateT e f) 
Alt f => Alt (WriterT w f) 
Alt f => Alt (WriterT w f) 
Alt f => Alt (RWST r w s f) 
Alt f => Alt (RWST r w s f) 

class Alt f => Plus f where

Laws:

 zero <!> m = m
 m <!> zero = m

If extended to an Alternative then zero should equal empty.

Methods

zero :: f a

Instances

Plus [] 
Plus IO 
Plus Maybe 
Plus Seq 
Plus IntMap 
Plus Option 
MonadPlus m => Plus (WrappedMonad m) 
Ord k => Plus (Map k) 
(Apply f, Applicative f) => Plus (ListT f) 
Alternative f => Plus (WrappedApplicative f) 
(Bind f, Monad f) => Plus (MaybeT f) 
Plus f => Plus (IdentityT f) 
ArrowPlus a => Plus (WrappedArrow a b) 
(Bind f, Monad f, Error e) => Plus (ErrorT e f) 
Plus f => Plus (ReaderT e f) 
Plus f => Plus (StateT e f) 
Plus f => Plus (StateT e f) 
Plus f => Plus (WriterT w f) 
Plus f => Plus (WriterT w f) 
Plus f => Plus (RWST r w s f) 
Plus f => Plus (RWST r w s f)