heftia-effects-0.7.0.0: higher-order algebraic effects done right
Copyright(c) 2024 Sayo contributors
LicenseMPL-2.0 (see the LICENSE file)
Maintainerymdfield@outlook.jp
Safe HaskellNone
LanguageGHC2021

Control.Monad.Hefty.NonDet

Description

Interpreters for the non-determinism effects.

Synopsis

Documentation

runNonDet :: forall f (es :: [Effect]) a. (Alternative f, FOEs es) => Eff (Choose ': (Empty ': es)) a -> Eff es (f a) Source #

NonDet effects handler for alternative answer type.

runNonDetMonoid :: forall ans (es :: [Effect]) a. (Monoid ans, FOEs es) => (a -> Eff es ans) -> Eff (Choose ': (Empty ': es)) a -> Eff es ans Source #

NonDet effects handler for monoidal answer type.

runChoose :: forall f (es :: [Effect]) a. (Alternative f, FOEs es) => Eff (Choose ': es) a -> Eff es (f a) Source #

Choose effect handler for alternative answer type.

runChooseMonoid :: forall ans (es :: [Effect]) a. (Semigroup ans, FOEs es) => (a -> Eff es ans) -> Eff (Choose ': es) a -> Eff es ans Source #

Choose effect handler for monoidal answer type.

runEmpty :: forall a (es :: [Effect]). FOEs es => Eff (Empty ': es) a -> Eff es (Maybe a) Source #

Empty effect handler.