Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility functions based on Template
to offer $var
variable
expansion in string throughout a B9 artifact.
- subst :: [(String, String)] -> String -> String
- substE :: [(String, String)] -> String -> Either String String
- substEB :: [(String, String)] -> ByteString -> Either String ByteString
- substFile :: MonadIO m => [(String, String)] -> FilePath -> FilePath -> m ()
- substPath :: [(String, String)] -> SystemPath -> SystemPath
- readTemplateFile :: (MonadIO m, MonadReader Environment m) => SourceFile -> m ByteString
- data SourceFile = Source SourceFileConversion FilePath
- data SourceFileConversion
- data Environment = Environment [(String, String)]
- withEnvironment :: [(String, String)] -> ReaderT Environment m a -> m a
Documentation
substEB :: [(String, String)] -> ByteString -> Either String ByteString Source
substPath :: [(String, String)] -> SystemPath -> SystemPath Source
readTemplateFile :: (MonadIO m, MonadReader Environment m) => SourceFile -> m ByteString Source
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.
data Environment Source
Environment [(String, String)] |
withEnvironment :: [(String, String)] -> ReaderT Environment m a -> m a Source