Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility functions based on Template
to offer $var
variable
expansion in string throughout a B9 artifact.
@deprecated
TODO remove this in the move to Dhall
Synopsis
- subst :: (Member ExcB9 e, Member EnvironmentReader e) => Text -> Eff e Text
- substStr :: (Member ExcB9 e, Member EnvironmentReader e) => String -> Eff e String
- substFile :: (Member EnvironmentReader e, Member ExcB9 e, MonadIO (Eff e)) => FilePath -> FilePath -> Eff e ()
- substPath :: (Member EnvironmentReader e, Member ExcB9 e) => SystemPath -> Eff e SystemPath
- readTemplateFile :: (MonadIO (Eff e), '[ExcB9, EnvironmentReader] <:: e) => SourceFile -> Eff e Text
- withSubstitutedStringBindings :: (Member EnvironmentReader e, Member ExcB9 e) => [(String, String)] -> Eff e s -> Eff e s
- data SourceFile = Source SourceFileConversion FilePath
- data SourceFileConversion
Documentation
subst :: (Member ExcB9 e, Member EnvironmentReader e) => Text -> Eff e Text Source #
Text
template substitution.
substStr :: (Member ExcB9 e, Member EnvironmentReader e) => String -> Eff e String Source #
String
template substitution
substFile :: (Member EnvironmentReader e, Member ExcB9 e, MonadIO (Eff e)) => FilePath -> FilePath -> Eff e () Source #
substPath :: (Member EnvironmentReader e, Member ExcB9 e) => SystemPath -> Eff e SystemPath Source #
readTemplateFile :: (MonadIO (Eff e), '[ExcB9, EnvironmentReader] <:: e) => SourceFile -> Eff e Text Source #
withSubstitutedStringBindings :: (Member EnvironmentReader e, Member ExcB9 e) => [(String, String)] -> Eff e s -> Eff e s Source #
Extend an Environment
with new bindings, where each value may contain
string templates with like "Hello $name, how is life on $planet these days?"
.
Since: 0.5.64
data SourceFile Source #
A wrapper around a file path and a flag indicating if template variable expansion should be performed when reading the file contents.
Instances
data SourceFileConversion Source #