grisette-monad-coroutine-0.1.0.0: Support for monad-coroutine package with Grisette
Copyright(c) Sirui Lu 2021-2023
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Grisette.Lib.Control.Monad.Coroutine

Description

 
Synopsis

Documentation

mrgSuspend :: forall m s x. (Functor s, MonadUnion m, Mergeable x, Mergeable1 s) => s (Coroutine s m x) -> Coroutine s m x Source #

Symbolic version of suspend, the result would be merged and propagate the mergeable knowledge.

mrgMapMonad :: forall s m m' x. (Functor s, Mergeable1 s, Mergeable x, Monad m, MonadUnion m') => (forall y. m y -> m' y) -> Coroutine s m x -> Coroutine s m' x Source #

Symbolic version of mapMonad, the result would be merged and propagate the mergeable knowledge.

mrgMapSuspension :: forall s m x s'. (Functor s, MonadUnion m, Mergeable x, Mergeable1 s') => (forall y. s y -> s' y) -> Coroutine s m x -> Coroutine s' m x Source #

Symbolic version of mapSuspension, the result would be merged and propagate the mergeable knowledge.

mrgMapFirstSuspension :: forall s m x. (Functor s, Mergeable1 s, MonadUnion m, Mergeable x) => (forall y. s y -> s y) -> Coroutine s m x -> Coroutine s m x Source #

Symbolic version of mapFirstSuspension, the result would be merged and propagate the mergeable knowledge.

mrgRunCoroutine :: (MonadUnion m, Mergeable x) => Coroutine Naught m x -> m x Source #

Symbolic version of mapFirstSuspension, the result would be merged and propagate the mergeable knowledge.

mrgBounce :: (Functor s, Mergeable1 s, MonadUnion m, Mergeable x) => (s (Coroutine s m x) -> Coroutine s m x) -> Coroutine s m x -> Coroutine s m x Source #

Symbolic version of bounce, the result would be merged and propagate the mergeable knowledge.

mrgPogoStick :: (MonadUnion m, Mergeable x) => (s (Coroutine s m x) -> Coroutine s m x) -> Coroutine s m x -> m x Source #

Symbolic version of pogoStick, the result would be merged and propagate the mergeable knowledge.

mrgPogoStickM :: (MonadUnion m, Mergeable x) => (s (Coroutine s m x) -> m (Coroutine s m x)) -> Coroutine s m x -> m x Source #

Symbolic version of pogoStickM, the result would be merged and propagate the mergeable knowledge.

mrgFoldRun :: (MonadUnion m, Mergeable x, Mergeable a) => (a -> s (Coroutine s m x) -> (a, Coroutine s m x)) -> a -> Coroutine s m x -> m (a, x) Source #

Symbolic version of foldRun, the result would be merged and propagate the mergeable knowledge.

type MrgPairBinder bool m = forall x y r. Mergeable r => (x -> y -> m r) -> m x -> m y -> m r Source #

Type of functions that can bind two monadic values together, used to combine two coroutines' step results. The result type needs to be mergeable.

mrgSequentialBinder :: MonadUnion m => MrgPairBinder bool m Source #

Symbolic version of sequentialBinder, the result would be merged and propagate the mergeable knowledge.

Orphan instances

Mergeable1 Naught Source # 
Instance details

SimpleMergeable1 Naught Source # 
Instance details

Methods

liftMrgIte :: (SymBool -> a -> a -> a) -> SymBool -> Naught a -> Naught a -> Naught a #

Mergeable (Naught x) Source # 
Instance details

SimpleMergeable (Naught x) Source # 
Instance details

Methods

mrgIte :: SymBool -> Naught x -> Naught x -> Naught x #

(Mergeable1 m, Mergeable1 sus) => Mergeable1 (Coroutine sus m) Source # 
Instance details

(UnionLike m, Mergeable1 sus) => SimpleMergeable1 (Coroutine sus m) Source # 
Instance details

Methods

liftMrgIte :: (SymBool -> a -> a -> a) -> SymBool -> Coroutine sus m a -> Coroutine sus m a -> Coroutine sus m a #

(UnionLike m, Mergeable1 sus) => UnionLike (Coroutine sus m) Source # 
Instance details

Methods

single :: a -> Coroutine sus m a #

unionIf :: SymBool -> Coroutine sus m a -> Coroutine sus m a -> Coroutine sus m a #

mergeWithStrategy :: MergingStrategy a -> Coroutine sus m a -> Coroutine sus m a #

mrgIfWithStrategy :: MergingStrategy a -> SymBool -> Coroutine sus m a -> Coroutine sus m a -> Coroutine sus m a #

mrgSingleWithStrategy :: MergingStrategy a -> a -> Coroutine sus m a #

ExtractSymbolics (m (Either (sus (Coroutine sus m a)) a)) => ExtractSymbolics (Coroutine sus m a) Source # 
Instance details

Methods

extractSymbolics :: Coroutine sus m a -> SymbolSet #

(Mergeable1 m, Mergeable a, Mergeable1 sus) => Mergeable (Coroutine sus m a) Source # 
Instance details

(UnionLike m, Mergeable a, Mergeable1 sus) => SimpleMergeable (Coroutine sus m a) Source # 
Instance details

Methods

mrgIte :: SymBool -> Coroutine sus m a -> Coroutine sus m a -> Coroutine sus m a #