extensible-effects-2.0.1.0: An Alternative to Monad Transformers

Safe HaskellSafe
LanguageHaskell2010

Control.Eff.Choose

Description

Nondeterministic choice effect

Synopsis

Documentation

newtype Choose a Source #

Non-determinism (choice)

choose lst non-deterministically chooses one value from the lst choose [] thus corresponds to failure Unlike Reader, Choose is not a GADT because the type of values returned in response to a (Choose a) request is just a, without any constraints.

Constructors

Choose [a] 

choose :: Member Choose r => [a] -> Eff r a Source #

choose lst non-deterministically chooses one value from the lst choose [] thus corresponds to failure

makeChoice :: forall a r. Eff (Choose ': r) a -> Eff r [a] Source #

Run a nondeterministic effect, returning all values.

mzero' :: Member Choose r => Eff r a Source #

MonadPlus-like operators are expressible via choose

mplus' :: Member Choose r => Eff r a -> Eff r a -> Eff r a Source #

MonadPlus-like operators are expressible via choose