funflow-1.3.2: Workflows with arrows

Safe HaskellNone
LanguageHaskell2010

Control.Funflow.Steps

Contents

Description

Miscallaneous steps to form part of Funflow computations.

Synopsis

Error handling

retry :: forall arr eff ex a b. (Exception ex, Store a, ArrowFlow eff ex arr) => Int -> Int -> arr a b -> arr a b Source #

`retry n s f` reruns f on failure at most n times with a delay of s seconds between retries

Store manipulation

assignAliasInStore :: ArrowFlow eff ex arr => arr (Alias, Item) () Source #

copyDirToStore :: ArrowFlow eff ex arr => arr (DirectoryContent, Maybe (Path Rel Dir)) (Content Dir) Source #

copyDirToStore (dIn, Nothing) copies the contents of dIn into the store right under the subtree.

| copyDirToStore (dIn, Just dOut) copies the contents of dIn into the store under relative path dOut within the subtree

copyFileToStore :: ArrowFlow eff ex arr => arr (FileContent, Path Rel File) (Content File) Source #

copyFileToStore (fIn, fOut) copies the contents of fIn into the store under the relative path fOut within the subtree.

listDirContents :: ArrowFlow eff ex arr => arr (Content Dir) ([Content Dir], [Content File]) Source #

List the contents of a directory within the store

globDir :: ArrowFlow eff ex arr => arr (Content Dir, String) [Content File] Source #

Search for files in the directory matching the given text string, as a glob pattern.

globDirPattern :: ArrowFlow eff ex arr => arr (Content Dir, Pattern) [Content File] Source #

Search for files in the directory matching the given pattern.

mergeDirs :: ArrowFlow eff ex arr => arr [Content Dir] (Content Dir) Source #

Merge a number of store directories together into a single output directory. This uses hardlinks to avoid duplicating the data on disk.

mergeFiles :: ArrowFlow eff ex arr => arr [Content File] (Content Dir) Source #

Merge a number of files into a single output directory.

putInStoreAt :: (ContentHashable IO a, Typeable t, ArrowFlow eff ex arr) => (Path Abs t -> a -> IO ()) -> arr (a, Path Rel t) (Content t) Source #

readString :: ArrowFlow eff ex arr => arr (Content File) String Source #

Read the contents of the given file in the store.

readString_ :: ArrowFlow eff ex arr => arr Item String Source #

Read the contents of a file named out within the given item.

readYaml :: FromJSON a => SimpleFlow (Content File) (Either ParseException a) Source #

Read a YAML file from the given file in the store.

writeString :: ArrowFlow eff ex arr => arr (String, Path Rel File) (Content File) Source #

Create and write into a file under the given path in the store.

writeString_ :: ArrowFlow eff ex arr => arr String (Content File) Source #

Create and write into a file named out within the given item.

writeYaml :: (ContentHashable IO a, ToJSON a) => SimpleFlow (a, Path Rel File) (Content File) Source #

Write a YAML file under the given name to the store.

writeYaml_ :: (ContentHashable IO a, ToJSON a) => SimpleFlow a (Content File) Source #

Write a YAML file named out.yaml to the store.

Docker

docker :: (ContentHashable IO a, ArrowFlow eff ex arr) => (a -> Config) -> arr a Item Source #

Testing and debugging

promptFor :: (Read a, ArrowFlow eff ex arr) => arr String a Source #

printS :: (Show a, ArrowFlow eff ex arr) => arr a () Source #

failStep :: ArrowFlow eff ex arr => arr () () Source #

worstBernoulli :: (Exception ex, ArrowFlow eff ex arr) => (String -> ex) -> arr Double Double Source #

pauseWith :: (Store a, ArrowFlow eff ex arr) => arr (Int, a) a Source #

pause for a given number of seconds. Thread through a value to ensure delay does not happen inparallel with other processing

melancholicLazarus :: ArrowFlow eff ex arr => arr String String Source #

on first invocation die and leave a suicide note on second invocation it is resurrected and destroys suicide note, returning contents