Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 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 #
A carrier for Choose
effects based on Ralf Hinze’s design described in Deriving Backtracking Monad Transformers.
Since: 1.0.0.0
ChooseC (forall b. (m b -> m b -> m b) -> (a -> m b) -> m b) |
Instances
MonadTrans ChooseC Source # | |
Defined in Control.Carrier.Choose.Church | |
Monad (ChooseC m) Source # | |
Functor (ChooseC m) Source # | |
MonadFix m => MonadFix (ChooseC m) Source # | Separate fixpoints are computed for each branch. |
Defined in Control.Carrier.Choose.Church | |
MonadFail m => MonadFail (ChooseC m) Source # | |
Defined in Control.Carrier.Choose.Church | |
Applicative (ChooseC m) Source # | |
MonadIO m => MonadIO (ChooseC m) Source # | |
Defined in Control.Carrier.Choose.Church | |
(Algebra sig m, Effect sig) => Algebra (Choose :+: sig) (ChooseC m) Source # | |
Choose effect
module Control.Effect.Choose