achille-0.0.0: A library for building static site generators
Safe HaskellNone
LanguageHaskell2010

Achille.Task

Description

Defines core combinators for processing files incrementally.

Synopsis

Documentation

type Task m = Recipe m () Source #

A task is a recipe with no input

match :: (AchilleIO m, Binary a) => Pattern -> Recipe m FilePath a -> Recipe m c [a] Source #

Run a recipe on every filepath matching a given pattern. The results are cached and the recipe only recomputes when the underlying file has changed since last run.

match_ :: AchilleIO m => Pattern -> Recipe m FilePath a -> Task m () Source #

Run a recipe on every filepath matching a given pattern, and discard the result. Filepaths are cached and the recipe only recomputes when the underlying file has changed since last run.

matchFile :: (AchilleIO m, Binary a) => Pattern -> Recipe m FilePath a -> Recipe m b a Source #

Run a recipe for a filepath matching a given pattern. The result is cached and the recipe only recomputes when the underlying file has changed since last run. Will fail is no file is found matching the pattern.

matchDir :: AchilleIO m => Pattern -> Recipe m FilePath a -> Recipe m c [a] Source #

For every file matching the pattern, run a recipe with the file as input and with the file's parent directory as current working directory. The underlying recipe will be run regardless of whether the file was modified.

with :: (Applicative m, Binary a, Eq a, Binary b) => a -> Recipe m c b -> Recipe m c b Source #

Cache a value and only trigger a given recipe if said value has changed between runs. cache the result of the recipe.

watch :: (Functor m, Binary a, Eq a) => a -> Recipe m c b -> Recipe m c b Source #

Cache a value and only trigger a given recipe if said value has changed between runs. Like with, but the result of the recipe won't be cached. If the recipe must be retriggered, it will be in depth.

runTask Source #

Arguments

:: MonadIO m 
=> [Pattern]

Files for which we force recompilation

-> Config

The config

-> Task m a

The task

-> m a 

Run a task using the provided config and a list of dirty files. This takes care of loading the existing cache and updating it.