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

Control.Monad.Hefty.NonDet

Description

Interpreters for the non-determinism effects.

Synopsis

Documentation

runNonDet :: forall f es 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 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 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 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. FOEs es => Eff (Empty ': es) a -> Eff es (Maybe a) Source #

Empty effect handler.