circuitflow-0.3.0.1
Safe HaskellNone
LanguageHaskell2010

Pipeline.Internal.Core.DataStore

Synopsis

Documentation

class DataStore f a where #

DataStore that can be defined for each datastore needed to be used.

Methods

fetch :: f a -> IO a #

Fetch the value stored in the DataStore

save :: f a -> a -> IO () #

Save a value into the DataStore

The first argument depends on the instance. It may be "empty" or it could be a pointer to a storage location.

empty :: TaskUUID -> JobUUID -> IO (f a) #

Returns a new empty store

Instances

Instances details
DataStore Var a # 
Instance details

Defined in Pipeline.Internal.Core.DataStore

Methods

fetch :: Var a -> IO a #

save :: Var a -> a -> IO () #

empty :: TaskUUID -> JobUUID -> IO (Var a) #

DataStore (FileStore :: Type -> Type) String #

You are able to write a String to a FileStore.

Instance details

Defined in Pipeline.DataStore

(ToNamedRecord a, FromNamedRecord a, DefaultOrdered a) => DataStore (NamedCSVStore :: Type -> Type) [a] #

A list of any type can be wrote to a CSV as long as it has a ToNamedRecord, FromNamedRecord, and DefaultOrdered instance defined.

Instance details

Defined in Pipeline.DataStore

Methods

fetch :: NamedCSVStore [a] -> IO [a] #

save :: NamedCSVStore [a] -> [a] -> IO () #

empty :: TaskUUID -> JobUUID -> IO (NamedCSVStore [a]) #

(ToRecord a, FromRecord a) => DataStore (CSVStore :: Type -> Type) [a] #

A list of any type can be wrote to a CSV as long as it has a ToRecord and FromRecord instance defined.

Instance details

Defined in Pipeline.DataStore

Methods

fetch :: CSVStore [a] -> IO [a] #

save :: CSVStore [a] -> [a] -> IO () #

empty :: TaskUUID -> JobUUID -> IO (CSVStore [a]) #

DataStore (FileStore :: Type -> Type) [String] #

It is possible to write a list of strings to a FileStore. A new line is added between each string in the list.

Instance details

Defined in Pipeline.DataStore

class DataStore' (fs :: [Type -> Type]) (as :: [Type]) where #

When tasks require multiple inputs, they also require a joint DataStore. This class provides this ability.

A user does not need to define instances of this class, however it is useful when defining your own tasks.

Methods

fetch' :: HList' fs as -> IO (HList as) #

Fetch the value stored in the DataStore'

save' :: HList' fs as -> HList as -> IO () #

Save a value into the DataStore'

The first argument depends on the instance. It may be "empty" or it could be a pointer to a storage location.

empty' :: TaskUUID -> JobUUID -> IO (HList' fs as) #

Instances

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

Defined in Pipeline.Internal.Core.DataStore

Methods

fetch' :: HList' (f ': fs) (a ': as) -> IO (HList (a ': as)) #

save' :: HList' (f ': fs) (a ': as) -> HList (a ': as) -> IO () #

empty' :: TaskUUID -> JobUUID -> IO (HList' (f ': fs) (a ': as)) #

(DataStore f a, Eq a, Eq (f a)) => DataStore' '[f] '[a] # 
Instance details

Defined in Pipeline.Internal.Core.DataStore

Methods

fetch' :: HList' '[f] '[a] -> IO (HList '[a]) #

save' :: HList' '[f] '[a] -> HList '[a] -> IO () #

empty' :: TaskUUID -> JobUUID -> IO (HList' '[f] '[a]) #

data Var a #

Simple in memory variable store, and unmutable.

Instances

Instances details
DataStore Var a # 
Instance details

Defined in Pipeline.Internal.Core.DataStore

Methods

fetch :: Var a -> IO a #

save :: Var a -> a -> IO () #

empty :: TaskUUID -> JobUUID -> IO (Var a) #

Eq (Var a) # 
Instance details

Defined in Pipeline.Internal.Core.DataStore

Methods

(==) :: Var a -> Var a -> Bool #

(/=) :: Var a -> Var a -> Bool #

emptyVar :: IO (Var a) #