extensible-effects-1.9.1.0: An Alternative to Monad Transformers

Safe HaskellTrustworthy
LanguageHaskell2010

Control.Eff.Choose

Description

Nondeterministic choice effect

Synopsis

Documentation

data Choose v Source

Nondeterministic choice

Constructors

forall a . Choose [a] (a -> v) 

Instances

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

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

runChoice :: 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