Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.
Equivalent to substituteValue . toMustache.
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Modulemustache-2.4.3.1Haskell2010
Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.
Equivalent to substituteValue . toMustache.
Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.
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.
Type of errors we may encounter during substitution.
VariableNotFound [Key]The template contained a variable for which there was no data counterpart in the current context
InvalidImplicitSectionContextType StringWhen substituting an implicit section the current context had an unsubstitutable type
InvertedImplicitSectionInverted implicit sections should never occur
SectionTargetNotFound [Key]The template contained a section for which there was no data counterpart in the current context
PartialNotFound FilePathThe template contained a partial for which there was no data counterpart in the current context
DirectlyRenderedValue ValueA complex value such as an Object or Array was directly rendered into the template (warning)
Show SubstitutionErrorDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesRepresentation of stateful context for the substitution process
ContextctxtParents :: [α]ctxtFocus :: αEq α => Eq (Context α)Defined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesOrd α => Ord (Context α)Defined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesShow α => Show (Context α)Defined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesToMustache (Context Value -> STree -> String)Defined in mustache-2.4.3.1 · Text.Mustache.Render · orphanToMustache (Context Value -> STree -> STree)Defined in mustache-2.4.3.1 · Text.Mustache.Render · orphanToMustache (Context Value -> STree -> Text)Defined in mustache-2.4.3.1 · Text.Mustache.Render · orphanToMustache (Context Value -> STree -> Text)Defined in mustache-2.4.3.1 · Text.Mustache.Render · orphanMonadReader (Context Value, TemplateCache) SubMDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesSearch 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.
Searches nested scopes navigating inward. Fails if it encunters something other than an object before the key is expended.
Monad SubMDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesFunctor SubMDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesApplicative SubMDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesToMustache (STree -> SubM STree)Defined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesToMustache (STree -> SubM Text)Defined in mustache-2.4.3.1 · Text.Mustache.Render · orphanMonadReader (Context Value, TemplateCache) SubMDefined in mustache-2.4.3.1 · Text.Mustache.Internal.TypesMain substitution function
Catch the results of running the inner substitution.
Converts values to Text as required by the mustache standard
ToMustache (Context Value -> STree -> String)ToMustache (Context Value -> STree -> STree)ToMustache (Context Value -> STree -> Text)ToMustache (Context Value -> STree -> Text)ToMustache (STree -> SubM Text)