set-algebra-0.1.0.0: Set Algebra
Safe Haskell Safe-Inferred
Language Haskell2010

Control.Iterate.Collect

Synopsis

Documentation

newtype Cont ans x Source #

Constructors

Cont

Fields

Instances

Instances details
Monad ( Cont r) Source #
Instance details

Defined in Control.Iterate.Collect

Functor ( Cont ans) Source #
Instance details

Defined in Control.Iterate.Collect

Methods

fmap :: (a -> b) -> Cont ans a -> Cont ans b Source #

(<$) :: a -> Cont ans b -> Cont ans a Source #

Applicative ( Cont ans) Source #
Instance details

Defined in Control.Iterate.Collect

Methods

pure :: a -> Cont ans a Source #

(<*>) :: Cont ans (a -> b) -> Cont ans a -> Cont ans b Source #

liftA2 :: (a -> b -> c) -> Cont ans a -> Cont ans b -> Cont ans c Source #

(*>) :: Cont ans a -> Cont ans b -> Cont ans b Source #

(<*) :: Cont ans a -> Cont ans b -> Cont ans a Source #

newtype Collect tuple Source #

Constructors

Collect

Fields

  • runCollect :: forall ans. ans -> (tuple -> ans -> ans) -> ans

Instances

Instances details
Monad Collect Source #
Instance details

Defined in Control.Iterate.Collect

Functor Collect Source #
Instance details

Defined in Control.Iterate.Collect

Applicative Collect Source #
Instance details

Defined in Control.Iterate.Collect

Foldable Collect Source #
Instance details

Defined in Control.Iterate.Collect

Show t => Show ( Collect t) Source #

Even though a (Collect t) is a function, if we can (Show t), we can pick an action that collects all the shown t, and turn them into a big multi-line string.

Instance details

Defined in Control.Iterate.Collect

fixAction :: Collect tuple -> ans -> (tuple -> ans -> ans) -> ans Source #

A (Collect t) is completely agnostic over how t s are beging collected. We can make this abstraction concrete by using fixAction.

one :: t -> Collect t Source #

Here are several ways to add a new t to what is being collected.

The one and none interface are used when we want collections with 0 or 1 elements

front :: t -> Collect t -> Collect t Source #

The front and rear interface can add to either end of the sequence (both in constant time)

when :: Bool -> Collect () Source #

Conditional collecting

runPlus :: Monoid a => ColPlus t -> a -> (t -> a -> a) -> a Source #