HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulemustache-2.4.3.1Haskell2010

Text.Mustache.Render

  • 3 types
  • 10 values
  • Packagemustache-2.4.3.1
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceRender.hs

Substitution

2 declarations
valuesubstitute :: ToMustache k => Template -> k -> Text
#

Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.

Equivalent to substituteValue . toMustache.

Checked substitution

3 declarations

Substitutes all mustache defined tokens (or tags) for values found in the provided data structure and report any errors and warnings encountered during substitution.

This function always produces results, as in a fully substituted/rendered template, it never halts on errors. It simply reports them in the first part of the tuple. Sites with errors are usually substituted with empty string.

The second value in the tuple is a template rendered with errors ignored. Therefore if you must enforce that there were no errors during substitution you must check that the error list in the first tuple value is empty.

Equivalent to checkedSubstituteValue . toMustache.

Substitutes all mustache defined tokens (or tags) for values found in the provided data structure and report any errors and warnings encountered during substitution.

This function always produces results, as in a fully substituted/rendered template, it never halts on errors. It simply reports them in the first part of the tuple. Sites with errors are usually substituted with empty string.

The second value in the tuple is a template rendered with errors ignored. Therefore if you must enforce that there were no errors during substitution you must check that the error list in the first tuple value is empty.

datadata SubstitutionError
#

Type of errors we may encounter during substitution.

Constructors

Instances1Show

Working with Context

7 declarations
datadata Context α
#

Representation of stateful context for the substitution process

Constructors

Instances8Eq, Ord, Show, ToMustache, MonadReader, …
valuesearch :: [Key] -> SubM (Maybe Value)
#

Search for a key in the current context.

The search is conducted inside out mening the current focus is searched first. If the key is not found the outer scopes are recursively searched until the key is found, then innerSearch is called on the result.

valueinnerSearch :: [Key] -> Value -> Maybe Value
#

Searches nested scopes navigating inward. Fails if it encunters something other than an object before the key is expended.

newtypenewtype SubM a
#
Instances6Monad, Functor, Applicative, ToMustache, MonadReader

Util

1 declaration

Orphan instances

5 instances