| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Carrier.Choose.Church
Contents
Description
A carrier for Choose effects (nondeterminism without failure).
Under the hood, it uses a Church-encoded binary tree to avoid the problems associated with a naïve list-based implementation (see "ListT done right").
Since: 1.0.0.0
Synopsis
- runChoose :: (m b -> m b -> m b) -> (a -> m b) -> ChooseC m a -> m b
- runChooseS :: (Semigroup b, Applicative m) => (a -> m b) -> ChooseC m a -> m b
- newtype ChooseC (m :: Type -> Type) a = ChooseC (forall b. (m b -> m b -> m b) -> (a -> m b) -> m b)
- module Control.Effect.Choose
Choose carrier
runChooseS :: (Semigroup b, Applicative m) => (a -> m b) -> ChooseC m a -> m b Source #
newtype ChooseC (m :: Type -> Type) a Source #
A carrier for Choose effects based on Ralf Hinze’s design described in Deriving Backtracking Monad Transformers.
Since: 1.0.0.0
Constructors
| ChooseC (forall b. (m b -> m b -> m b) -> (a -> m b) -> m b) |
Instances
| MonadTrans ChooseC Source # | |
Defined in Control.Carrier.Choose.Church | |
| Applicative (ChooseC m) Source # | |
Defined in Control.Carrier.Choose.Church | |
| Functor (ChooseC m) Source # | |
| Monad (ChooseC m) Source # | |
| MonadFail m => MonadFail (ChooseC m) Source # | |
Defined in Control.Carrier.Choose.Church | |
| MonadFix m => MonadFix (ChooseC m) Source # | Separate fixpoints are computed for each branch. |
Defined in Control.Carrier.Choose.Church | |
| MonadIO m => MonadIO (ChooseC m) Source # | |
Defined in Control.Carrier.Choose.Church | |
| Algebra sig m => Algebra (Choose :+: sig) (ChooseC m) Source # | |
Choose effect
module Control.Effect.Choose