data-effects-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.; 2017 Alexis King
(c) 2023-2024 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Data.Effect.Coroutine

Description

This module provides the Coroutine effect, comes from Control.Monad.Freer.Coroutine in the freer-simple package (The continuation part (b -> c) has been removed. If necessary, please manually compose the Coyoneda) .

Documentation

data Yield a b c where Source #

Constructors

Yield :: forall a b. a -> Yield a b b 

type LYield a b = LiftFOE (Yield a b) Source #

pattern LYield :: forall a1 b a2 f. () => (a1 ~ b, ()) => a2 -> LiftFOE (Yield a2 b) f a1 Source #

yield :: SendFOE (Yield a b) f => a -> f b Source #

yield' :: forall {k} (tag :: k) a b f. SendFOE (Tag (Yield a b) tag) f => a -> f b Source #

yield'' :: forall {k} (key :: k) a b f. SendFOEBy key (Yield a b) f => a -> f b Source #

yield_ :: Yield a () <: f => a -> f () Source #

data Status (f :: Type -> Type) a b r Source #

Constructors

Done r 
Continue a (b -> f (Status f a b r)) 

Instances

Instances details
Functor f => Functor (Status f a b) Source # 
Instance details

Defined in Data.Effect.Coroutine

Methods

fmap :: (a0 -> b0) -> Status f a b a0 -> Status f a b b0 #

(<$) :: a0 -> Status f a b b0 -> Status f a b a0 #

continueStatus :: Monad m => (x -> m (Status m a b r)) -> Status m a b x -> m (Status m a b r) Source #

loopStatus :: Monad m => (a -> m b) -> Status m a b r -> m r Source #