circuitflow-0.3.0.1
Copyright(c) Riley Evans 2020
LicenseBSD 3-Clause
Maintainerhaskell@rly.rocks
Safe HaskellNone
LanguageHaskell2010

Pipeline.Network

Description

Contains the tools needed to create, interact with and stop a network.

Synopsis

Network

class Network n where #

Network typeclass

Methods

startNetwork #

Arguments

:: InitialPipes inS inT 
=> Circuit inS inT outS outT nin

The Circuit used to create the network

-> IO (n inS inT outS outT)

The created network

Starts a network with the given Circuit as specification.

stopNetwork :: n inS inT outS outT -> IO () #

Stops the given network

read #

Arguments

:: n inputsS inputsT outputsS outputsT

The network to retrieve inputs from

-> IO (JobUUID, Either TaskError (HList' outputsS outputsT))

The identifier for the output and the output values | Write a set of inputs into the network

This will read from the outputs of the network.

This is a blocking call, therefore if there are no outputs to be read then the program will deadlock.

write #

Arguments

:: JobUUID

A unique identifier for the input values

-> HList' inputsS inputsT

The input values

-> n inputsS inputsT outputsS outputsT

The network to input the values in to

-> IO () 

Instances

Instances details
Network BasicNetwork # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

startNetwork :: forall (inS :: [Type -> Type]) (inT :: [Type]) (outS :: [Type -> Type]) (outT :: [Type]) (nin :: Nat). InitialPipes inS inT => Circuit inS inT outS outT nin -> IO (BasicNetwork inS inT outS outT) #

stopNetwork :: forall (inS :: [Type -> Type]) (inT :: [Type]) (outS :: [Type -> Type]) (outT :: [Type]). BasicNetwork inS inT outS outT -> IO () #

read :: forall (inputsS :: [Type -> Type]) (inputsT :: [Type]) (outputsS :: [Type -> Type]) (outputsT :: [Type]). BasicNetwork inputsS inputsT outputsS outputsT -> IO (JobUUID, Either TaskError (HList' outputsS outputsT)) #

write :: forall (inputsS :: [Type -> Type]) (inputsT :: [Type]) (outputsS :: [Type -> Type]) (outputsT :: [Type]). JobUUID -> HList' inputsS inputsT -> BasicNetwork inputsS inputsT outputsS outputsT -> IO () #

Basic Network

data BasicNetwork (inputsStorageType :: [Type -> Type]) (inputsType :: [Type]) (outputsStorageType :: [Type -> Type]) (outputsType :: [Type]) #

Main type for storing information about the process network.

The type arguments align with the Circuit data type.

Instances

Instances details
Network BasicNetwork # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

startNetwork :: forall (inS :: [Type -> Type]) (inT :: [Type]) (outS :: [Type -> Type]) (outT :: [Type]) (nin :: Nat). InitialPipes inS inT => Circuit inS inT outS outT nin -> IO (BasicNetwork inS inT outS outT) #

stopNetwork :: forall (inS :: [Type -> Type]) (inT :: [Type]) (outS :: [Type -> Type]) (outT :: [Type]). BasicNetwork inS inT outS outT -> IO () #

read :: forall (inputsS :: [Type -> Type]) (inputsT :: [Type]) (outputsS :: [Type -> Type]) (outputsT :: [Type]). BasicNetwork inputsS inputsT outputsS outputsT -> IO (JobUUID, Either TaskError (HList' outputsS outputsT)) #

write :: forall (inputsS :: [Type -> Type]) (inputsT :: [Type]) (outputsS :: [Type -> Type]) (outputsT :: [Type]). JobUUID -> HList' inputsS inputsT -> BasicNetwork inputsS inputsT outputsS outputsT -> IO () #

BuildNetworkAlg BasicNetwork Map # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Map (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Task # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Task (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork DropR # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). DropR (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork DropL # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). DropL (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Swap # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Swap (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Beside # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Beside (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Then # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Then (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Replicate # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Replicate (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

BuildNetworkAlg BasicNetwork Id # 
Instance details

Defined in Pipeline.Internal.Backend.BasicNetwork

Methods

buildNetworkAlg :: forall (asS :: [Type -> Type]) (asT :: [Type]) (bsS :: [Type -> Type]) (bsT :: [Type]) (csS :: [Type -> Type]) (csT :: [Type]) (nbs :: k). Id (N BasicNetwork asS asT) bsS bsT csS csT nbs -> IO (N BasicNetwork asS asT bsS bsT csS csT nbs) #

Network IO

data JobUUID #

Instances

Instances details
Eq JobUUID # 
Instance details

Defined in Pipeline.Internal.Core.UUID

Methods

(==) :: JobUUID -> JobUUID -> Bool #

(/=) :: JobUUID -> JobUUID -> Bool #

Ord JobUUID # 
Instance details

Defined in Pipeline.Internal.Core.UUID

Show JobUUID # 
Instance details

Defined in Pipeline.Internal.Core.UUID

Input

input #

Arguments

:: Network n 
=> HList' inputsS inputsT

Inputs to the network

-> n inputsS inputsT outputsS outputsT

Network to insert the values in

-> IO JobUUID

Randomly generated identifier

Input values into a network. This will return a randomly generated identifier for the inputs.

input_ :: Network n => HList' inputsS inputsT -> n inputsS inputsT outputsS outputsT -> IO () #

A variant of input, however it will not return the randomly generated identifier.

Output

output_ :: Network n => n inputsS inputsT outputsS outputsT -> IO (Either TaskError (HList' outputsS outputsT)) #

A variant of read, that does not return the unique identifier.

This is a blocking call, therefore if there are no outputs to be read then the program will deadlock.

data HList' (fs :: [Type -> Type]) (as :: [Type]) where #

A heterogeneous list used as input/output to a network or task.

Constructors

HCons' :: Eq (f a) => f a -> HList' fs as -> HList' (f ': fs) (a ': as) 
HNil' :: HList' '[] '[] 

Instances

Instances details
Eq (HList' fs as) # 
Instance details

Defined in Pipeline.Internal.Common.HList

Methods

(==) :: HList' fs as -> HList' fs as -> Bool #

(/=) :: HList' fs as -> HList' fs as -> Bool #

Misc

class InitialPipes (inputsS :: [Type -> Type]) (inputsT :: [Type]) #

Used to build a list of pipes from a list of types.

Minimal complete definition

initialPipes

Instances

Instances details
InitialPipes ('[] :: [Type -> Type]) ('[] :: [Type]) # 
Instance details

Defined in Pipeline.Internal.Backend.Network

Methods

initialPipes :: IO (PipeList '[] '[]) #

(InitialPipes fs as, Eq (f a)) => InitialPipes (f ': fs) (a ': as) # 
Instance details

Defined in Pipeline.Internal.Backend.Network

Methods

initialPipes :: IO (PipeList (f ': fs) (a ': as)) #