Skip to content

Latest commit

 

History

History
108 lines (75 loc) · 1.75 KB

File metadata and controls

108 lines (75 loc) · 1.75 KB

Module Control.Process

AwaitF

data AwaitF f a r
  = AwaitF (f r) (r -> Process f a) (Process f a)

Process

data Process f a
  = Halt
  | Emit a (Process f a)
  | Await (Exists (AwaitF f a))
Instances
instance processSemigroup :: Semigroup (Process k a)
instance processMonoid :: Monoid (Process k a)
instance processFunctor :: Functor (Process f)
instance processApply :: Apply (Process f)
instance processApplicative :: Applicative (Process f)
instance processBind :: Bind (Process f)
instance processMonad :: Monad (Process f)

Source

type Source e a = Process (Eff e) a

Sink

type Sink e a = Source e (a -> Eff e Unit)

Channel

type Channel e a b = Source e (a -> Eff e b)

await

await :: forall f r a. f r -> (r -> Process f a) -> Process f a

emit

emit :: forall f a. a -> Process f a

eval

eval :: forall f a. f a -> Process f a

translate

translate :: forall f g a. (forall b. f b -> g b) -> Process f a -> Process g a

flatten

flatten :: forall f a. Process f (f a) -> Process f a

repeatedly

repeatedly :: forall f a. Process f a -> Process f a

evalMap

evalMap :: forall f a b. (a -> f b) -> Process f a -> Process f b

runFoldMap

runFoldMap :: forall f a b. (Monad f, Monoid b) => (a -> b) -> Process f a -> f b

runLog

runLog :: forall f a. (Monad f) => Process f a -> f (List a)

run

run :: forall f a. (Monad f) => Process f a -> f Unit