effin-0.1.0.0: A Typeable-free implementation of extensible effects

Safe HaskellNone
LanguageHaskell2010

Control.Effect.List

Synopsis

Documentation

data List a Source

Describes a nondeterminism (backtracking) effect.

Instances

runList :: Effect (List : es) a -> Effect es [a] Source

Obtains all possible values from a computation parameterized by a nondeterminism effect.

choose :: EffectList es => [a] -> Effect es a Source

Nondeterministically chooses a value from the input list.

never :: EffectList es => Effect es a Source

Describes a nondeterministic computation that never returns a value.

select :: EffectList es => [Effect es a] -> Effect es a Source

Nondeterministically chooses a value from a list of computations.

data Cut a Source

Describes a Prolog-like cut effect. This effect must be used with the List effect.

Instances

cut :: (EffectList es, EffectCut es) => Effect es a Source

Prevents backtracking past the point this value was invoked. Unlike Prolog's ! operator, cut will cause the current computation to fail immediately, instead of when it backtracks.

runCut :: EffectList es => Effect (Cut : es) a -> Effect es a Source

Handles the Cut effect. cuts have no effect beyond the scope of the computation passed to this function.