Safe Haskell | None |
---|---|
Language | Haskell2010 |
Central Funflow module.
This module just re-exports various other modules for convenience.
Synopsis
- type Flow eff ex = ErrorChoice ex (Flow' eff)
- type SimpleFlow = Flow NoEffect SomeException
- type (==>) = SimpleFlow
- data NoEffect a b
- data Flow' eff a b where
- Step :: Properties a b -> (a -> b) -> Flow' eff a b
- StepIO :: Properties a b -> (a -> IO b) -> Flow' eff a b
- External :: ExternalProperties a -> (a -> ExternalTask) -> Flow' eff a Item
- PutInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> Flow' eff a Item
- GetFromStore :: (Path Abs t -> IO a) -> Flow' eff (Content t) a
- InternalManipulateStore :: (ContentStore -> a -> IO b) -> Flow' eff a b
- Wrapped :: Properties a b -> eff a b -> Flow' eff a b
- data Cacher i o
- = NoCache
- | Cache {
- cacherKey :: Int -> i -> ContentHash
- cacherStoreValue :: o -> ByteString
- cacherReadValue :: ByteString -> o
- data ExternalProperties a = ExternalProperties {
- ep_mdpolicy :: MDWriter a ()
- ep_impure :: Bool
- type MDWriter i o = Maybe (i -> o -> [(Text, ByteString)])
- data Properties i o = Properties {}
- defaultCacherWithIdent :: (Store o, ContentHashable Identity i) => Int -> Cacher i o
- defaultCacher :: Q Exp
- defaultCacherLoc :: Int -> Q Exp
- class (ArrowChoice arr, ArrowError ex arr) => ArrowFlow eff ex arr | arr -> eff ex where
- step :: ArrowFlow eff ex arr => (a -> b) -> arr a b
- stepIO :: ArrowFlow eff ex arr => (a -> IO b) -> arr a b
- wrap :: ArrowFlow eff ex arr => eff a b -> arr a b
- withStore :: (MonadIO m, MonadMask m) => Path Abs Dir -> (ContentStore -> m a) -> m a
- module Control.Funflow.Steps
- module Control.Funflow.Exec.Simple
- module Control.Funflow.External
Documentation
type Flow eff ex = ErrorChoice ex (Flow' eff) Source #
type SimpleFlow = Flow NoEffect SomeException Source #
type (==>) = SimpleFlow Source #
data Flow' eff a b where Source #
Step :: Properties a b -> (a -> b) -> Flow' eff a b | |
StepIO :: Properties a b -> (a -> IO b) -> Flow' eff a b | |
External :: ExternalProperties a -> (a -> ExternalTask) -> Flow' eff a Item | |
PutInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> Flow' eff a Item | |
GetFromStore :: (Path Abs t -> IO a) -> Flow' eff (Content t) a | |
InternalManipulateStore :: (ContentStore -> a -> IO b) -> Flow' eff a b | |
Wrapped :: Properties a b -> eff a b -> Flow' eff a b |
Instances
ArrowFlow eff ex (Flow eff ex) Source # | |
Defined in Control.Funflow.Class step' :: Properties a b -> (a -> b) -> Flow eff ex a b Source # stepIO' :: Properties a b -> (a -> IO b) -> Flow eff ex a b Source # external :: (a -> ExternalTask) -> Flow eff ex a Item Source # external' :: ExternalProperties a -> (a -> ExternalTask) -> Flow eff ex a Item Source # wrap' :: Properties a b -> eff a b -> Flow eff ex a b Source # putInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> Flow eff ex a Item Source # getFromStore :: (Path Abs t -> IO a) -> Flow eff ex (Content t) a Source # internalManipulateStore :: (ContentStore -> a -> IO b) -> Flow eff ex a b Source # |
A cacher is responsible for controlling how steps are cached.
NoCache | This step cannot be cached (default). |
Cache | |
|
data ExternalProperties a Source #
Additional properties associated with external tasks.
ExternalProperties | |
|
Instances
Default (ExternalProperties a) Source # | |
Defined in Control.Funflow.Base def :: ExternalProperties a # |
data Properties i o Source #
Instances
Default (Properties i o) Source # | |
Defined in Control.Funflow.Base def :: Properties i o # |
defaultCacherWithIdent Source #
:: (Store o, ContentHashable Identity i) | |
=> Int | Seed for the cacher |
-> Cacher i o |
defaultCacher :: Q Exp Source #
Create a default cacher with a random identity.
Note that this cacher is deliberately conservative - e.g. if the application is recompiled, the cache will not be reused.
Create a default cacher based on the location of this splice. Note that this may lead to invalid cacheing if the code is changed without the version being updated.
Defines our primitive flow functions
class (ArrowChoice arr, ArrowError ex arr) => ArrowFlow eff ex arr | arr -> eff ex where Source #
step' :: Properties a b -> (a -> b) -> arr a b Source #
Create a flow from a pure function.
stepIO' :: Properties a b -> (a -> IO b) -> arr a b Source #
Create a flow from an IO action.
external :: (a -> ExternalTask) -> arr a Item Source #
Create an external task in the flow.
external' :: ExternalProperties a -> (a -> ExternalTask) -> arr a Item Source #
Create an external task with additional properties
wrap' :: Properties a b -> eff a b -> arr a b Source #
Create a flow from a user-defined effect.
putInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> arr a Item Source #
Create a flow which will write its incoming data to the store.
getFromStore :: (Path Abs t -> IO a) -> arr (Content t) a Source #
Create a flow which will read data from the given store item.
internalManipulateStore :: (ContentStore -> a -> IO b) -> arr a b Source #
Perform some internal manipulation of the content store.
Instances
ArrowFlow eff ex (Flow eff ex) Source # | |
Defined in Control.Funflow.Class step' :: Properties a b -> (a -> b) -> Flow eff ex a b Source # stepIO' :: Properties a b -> (a -> IO b) -> Flow eff ex a b Source # external :: (a -> ExternalTask) -> Flow eff ex a Item Source # external' :: ExternalProperties a -> (a -> ExternalTask) -> Flow eff ex a Item Source # wrap' :: Properties a b -> eff a b -> Flow eff ex a b Source # putInStore :: ContentHashable IO a => (Path Abs Dir -> a -> IO ()) -> Flow eff ex a Item Source # getFromStore :: (Path Abs t -> IO a) -> Flow eff ex (Content t) a Source # internalManipulateStore :: (ContentStore -> a -> IO b) -> Flow eff ex a b Source # |
step :: ArrowFlow eff ex arr => (a -> b) -> arr a b Source #
Create a flow from a pure function.
This is a variant on step'
which uses the default properties.
stepIO :: ArrowFlow eff ex arr => (a -> IO b) -> arr a b Source #
Create a flow from an IO action.
This is a variant on stepIO'
which uses the default properties.
withStore :: (MonadIO m, MonadMask m) => Path Abs Dir -> (ContentStore -> m a) -> m a Source #
Open the store under the given root and perform the given action. Closes the store once the action is complete
See also: open
module Control.Funflow.Steps
module Control.Funflow.Exec.Simple
module Control.Funflow.External