slab-0.0.2.0: A programmable markup language to generate HTML
Safe HaskellSafe-Inferred
LanguageHaskell2010

Slab.Evaluate

Description

Slab.Evaluate implements the evaluation stage of Slab, following both the parsing and pre-processing stages. This is responsible of reducing for instance 1 + 2 to 3, or transforming a loop construct to an actual list of HTML blocks.

Evaluation works on an abstract syntax tree (defined in Slab.Syntax) and currently reuses the sames types for its result.

The stage following evaluation is Slab.Execute, responsible of running external commands.

Synopsis

Documentation

evaluateFile :: FilePath -> IO (Either Error [Block]) Source #

Similar to preprocessFile but evaluate the template.

evaluate :: Monad m => Env -> [Text] -> [Block] -> ExceptT Error m [Block] Source #