Lastik-0.2: A library for compiling programs in a variety of languages

Lastik.Runner

Description

A module for running compilable data types that take a list of file paths to compile.

Synopsis

Documentation

type Runner r = r -> [FilePath] -> IO ExitCodeSource

A runner takes a list of file paths and runs a system command on them.

runner :: (r -> [FilePath] -> Runner r) -> Runner rSource

A runner that can access its arguments.

runnerPath :: ([FilePath] -> Runner r) -> Runner rSource

A runner that can access its list of file paths.

codeRunner :: ExitCode -> Runner rSource

A runner that always produces the given exit code.

pathRunner :: ([FilePath] -> IO ExitCode) -> Runner rSource

A runner that ignores its data type value.

valueRunner :: (r -> IO ExitCode) -> Runner rSource

A runner that ignores its list of file paths.

andThen :: (r -> [FilePath] -> IO a) -> (a -> Runner r) -> Runner rSource

Executes an action using runner arguments then produces a runner with the value of the previous action.

ifRun :: (ExitCode -> Bool) -> Runner r -> Runner r -> Runner rSource

Execute the second runner only if the exit code of the first runner satisfies the given predicate.

(+++) :: Runner r -> Runner r -> Runner rSource

Execute the second runner only if the exit code of the first runner is ExitSuccess.

(-+-) :: Runner r -> Runner r -> Runner rSource

Execute the second runner only if the exit code of the first runner is not ExitSuccess.

pathTransform :: ([FilePath] -> IO [FilePath]) -> Runner t -> Runner tSource

Transform the list of file paths before executing the runner.

(!!!) :: Compile c => Runner cSource

Execute the compile result as a system command.

(>->) :: (Output c, Compile c) => Runner cSource

Create the output target directory then execute the compile result as a system command.

(+>->) :: (Output c, Compile c, OutputReference c) => Runner cSource

Create the output target directory then incrementally execute the compile result as a system command. The output target is searched for the latest last-modification time and only those files in the output reference that are modified later than this time are submitted for compilation.

(->-) :: (Output c, Extension c, Compile c) => Runner cSource

A runner that recursively searches the output target for files that match a given extension and compiles them as a system command.

(+->-) :: (Output r, Extension r, Compile r, OutputReference r) => Runner rSource

A runner that recursively searches the output target for files that match a given extension and compiles them incrementally as a system command. The output target is searched for the latest last-modification time and only those files in the output reference that are modified later than this time are submitted for compilation.