Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Member List l => EffectList l
- data List a
- runList :: Effect (List :+ l) a -> Effect l [a]
- choose :: EffectList l => [a] -> Effect l a
- never :: EffectList l => Effect l a
- select :: EffectList l => [Effect l a] -> Effect l a
- class (EffectList l, Member Cut l) => CutEffect l
- data Cut a
- runCut :: EffectList l => Effect (Cut :+ l) a -> Effect l a
- cut :: CutEffect l => Effect l ()
- cutFalse :: CutEffect l => Effect l a
Documentation
runList :: Effect (List :+ l) a -> Effect l [a] Source #
Obtains all possible values from a computation parameterized by a nondeterminism effect.
choose :: EffectList l => [a] -> Effect l a Source #
Nondeterministically chooses a value from the input list.
never :: EffectList l => Effect l a Source #
Describes a nondeterministic computation that never returns a value.
select :: EffectList l => [Effect l a] -> Effect l a Source #
Nondeterministically chooses a value from a list of computations.
Describes a Prolog-like cut effect.
This effect must be used with the List
effect.
cut :: CutEffect l => Effect l () Source #
Prevents backtracking past the point this value was invoked, in the style of Prolog's "!" operator.
cutFalse :: CutEffect l => Effect l a Source #
Prevents backtracking past the point this value was invoked.
Unlike Prolog's "!" operator, cutFalse
will cause the current
computation to fail immediately, instead of when it backtracks.
Orphan instances
EffectList l => Alternative (Effect l) Source # | |
EffectList l => MonadPlus (Effect l) Source # | |