supply-chain-core-0.0.0.1: Composable request-response pipelines
Safe HaskellSafe-Inferred
LanguageGHC2021

SupplyChain.Core.Job

Description

 
Synopsis

Type

newtype Job up action product Source #

Monadic context that supports making requests, performing actions, and returning a single result

Constructors

FreeMonad (FreeMonad (Effect up action) product) 

Bundled Patterns

pattern Pure :: product -> Job up action product 
pattern Effect :: Effect up action x -> (x -> product) -> Job up action product 
pattern Request :: up x -> (x -> product) -> Job up action product 
pattern Perform :: action x -> (x -> product) -> Job up action product 
pattern Bind :: Job up action x -> (x -> Job up action a) -> Job up action a 

Instances

Instances details
Applicative (Job up action) Source # 
Instance details

Defined in SupplyChain.Core.Job

Methods

pure :: a -> Job up action a #

(<*>) :: Job up action (a -> b) -> Job up action a -> Job up action b #

liftA2 :: (a -> b -> c) -> Job up action a -> Job up action b -> Job up action c #

(*>) :: Job up action a -> Job up action b -> Job up action b #

(<*) :: Job up action a -> Job up action b -> Job up action a #

Functor (Job up action) Source # 
Instance details

Defined in SupplyChain.Core.Job

Methods

fmap :: (a -> b) -> Job up action a -> Job up action b #

(<$) :: a -> Job up action b -> Job up action a #

Monad (Job up action) Source # 
Instance details

Defined in SupplyChain.Core.Job

Methods

(>>=) :: Job up action a -> (a -> Job up action b) -> Job up action b #

(>>) :: Job up action a -> Job up action b -> Job up action b #

return :: a -> Job up action a #

Constructing

effect :: Effect up action product -> Job up action product Source #

perform :: action product -> Job up action product Source #

Perform an action in a job's Action context

order :: up product -> Job up action product Source #

Send a request via the job's upstream Interface

Running

run :: Monad action => Job (Const Void) action product -> action product Source #

Run a job in its Action context

eval :: Job (Const Void) (Const Void) product -> product Source #

Run a job that performs no actions

Alteration

alter :: (forall x. Effect up action x -> Job up' action' x) -> Job up action product -> Job up' action' product Source #