Safe Haskell | None |
---|---|
Language | Haskell2010 |
Miscallaneous steps to form part of Funflow computations.
Synopsis
- retry :: forall arr eff ex a b. (Exception ex, Store a, ArrowFlow eff ex arr, ArrowChoice arr) => Int -> Int -> arr a b -> arr a b
- assignAliasInStore :: ArrowFlow eff ex arr => arr (Alias, Item) ()
- copyDirToStore :: (ArrowChoice arr, ArrowFlow eff ex arr) => arr (DirectoryContent, Maybe (Path Rel Dir)) (Content Dir)
- copyFileToStore :: ArrowFlow eff ex arr => arr (FileContent, Path Rel File) (Content File)
- listDirContents :: ArrowFlow eff ex arr => arr (Content Dir) ([Content Dir], [Content File])
- globDir :: ArrowFlow eff ex arr => arr (Content Dir, String) [Content File]
- globDirPattern :: ArrowFlow eff ex arr => arr (Content Dir, Pattern) [Content File]
- lookupAliasInStore :: ArrowFlow eff ex arr => arr Alias (Maybe Item)
- mergeDirs :: ArrowFlow eff ex arr => arr [Content Dir] (Content Dir)
- mergeFiles :: ArrowFlow eff ex arr => arr [Content File] (Content Dir)
- putInStoreAt :: (ContentHashable IO a, Typeable t, ArrowFlow eff ex arr) => (Path Abs t -> a -> IO ()) -> arr (a, Path Rel t) (Content t)
- readString :: ArrowFlow eff ex arr => arr (Content File) String
- readString_ :: ArrowFlow eff ex arr => arr Item String
- readYaml :: FromJSON a => SimpleFlow (Content File) (Either ParseException a)
- writeExecutableString :: ArrowFlow eff ex arr => arr (String, Path Rel File) (Content File)
- writeString :: ArrowFlow eff ex arr => arr (String, Path Rel File) (Content File)
- writeString_ :: ArrowFlow eff ex arr => arr String (Content File)
- writeYaml :: (ContentHashable IO a, ToJSON a) => SimpleFlow (a, Path Rel File) (Content File)
- writeYaml_ :: (ContentHashable IO a, ToJSON a) => SimpleFlow a (Content File)
- docker :: (ContentHashable IO a, ArrowFlow eff ex arr) => (a -> Config) -> arr a Item
- promptFor :: (Read a, ArrowFlow eff ex arr) => arr String a
- printS :: (Show a, ArrowFlow eff ex arr) => arr a ()
- failStep :: ArrowFlow eff ex arr => arr () ()
- cachedFailStep :: ArrowFlow eff ex arr => arr () ()
- worstBernoulli :: (Exception ex, ArrowFlow eff ex arr) => (String -> ex) -> arr Double Double
- pauseWith :: (Store a, ArrowFlow eff ex arr) => arr (Int, a) a
- melancholicLazarus :: ArrowFlow eff ex arr => arr String String
Error handling
retry :: forall arr eff ex a b. (Exception ex, Store a, ArrowFlow eff ex arr, ArrowChoice 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
copyDirToStore :: (ArrowChoice arr, 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.
writeExecutableString :: ArrowFlow eff ex arr => arr (String, Path Rel File) (Content File) Source #
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
Testing and debugging
cachedFailStep :: ArrowFlow eff ex arr => arr () () Source #
worstBernoulli :: (Exception ex, ArrowFlow eff ex arr) => (String -> ex) -> arr Double Double Source #