Copyright | (c) Riley Evans 2020 |
---|---|
License | BSD 3-Clause |
Maintainer | haskell@rly.rocks |
Safe Haskell | None |
Language | Haskell2010 |
Contains the tools needed to create, interact with and stop a network.
Synopsis
- class Network n where
- startNetwork :: InitialPipes inS inT => Circuit inS inT outS outT nin -> IO (n inS inT outS outT)
- stopNetwork :: n inS inT outS outT -> IO ()
- read :: n inputsS inputsT outputsS outputsT -> IO (JobUUID, Either TaskError (HList' outputsS outputsT))
- write :: JobUUID -> HList' inputsS inputsT -> n inputsS inputsT outputsS outputsT -> IO ()
- data BasicNetwork (inputsStorageType :: [Type -> Type]) (inputsType :: [Type]) (outputsStorageType :: [Type -> Type]) (outputsType :: [Type])
- data JobUUID
- input :: Network n => HList' inputsS inputsT -> n inputsS inputsT outputsS outputsT -> IO JobUUID
- input_ :: Network n => HList' inputsS inputsT -> n inputsS inputsT outputsS outputsT -> IO ()
- output_ :: Network n => n inputsS inputsT outputsS outputsT -> IO (Either TaskError (HList' outputsS outputsT))
- data HList' (fs :: [Type -> Type]) (as :: [Type]) where
- class InitialPipes (inputsS :: [Type -> Type]) (inputsT :: [Type])
Network
Network typeclass
:: InitialPipes inS inT | |
=> Circuit inS inT outS outT nin | The |
-> 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
:: 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.
Instances
Network BasicNetwork # | |
Defined in Pipeline.Internal.Backend.BasicNetwork 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
Network IO
Input
:: 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.
Misc
class InitialPipes (inputsS :: [Type -> Type]) (inputsT :: [Type]) #
Used to build a list of pipes from a list of types.
Instances
InitialPipes ('[] :: [Type -> Type]) ('[] :: [Type]) # | |
Defined in Pipeline.Internal.Backend.Network initialPipes :: IO (PipeList '[] '[]) # | |
(InitialPipes fs as, Eq (f a)) => InitialPipes (f ': fs) (a ': as) # | |
Defined in Pipeline.Internal.Backend.Network initialPipes :: IO (PipeList (f ': fs) (a ': as)) # |