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.Compile

  • 1 type
  • 9 values
  • Packagemustache-2.4.3.1
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCompile.hs

Compiles a mustache template provided by name including the mentioned partials.

The same can be done manually using getFile, mustacheParser and getPartials.

This function also ensures each partial is only compiled once even though it may be included by other partials including itself.

A reference to the included template will be found in each including templates partials section.

valuegetPartials :: STree -> [FilePath]
#

Find the names of all included partials in a mustache STree.

Same as join . fmap getPartials'

valuemustache :: QuasiQuoter
#

Compile a mustache Template at compile time. Usage:

{-# LANGUAGE QuasiQuotes #-}
import Text.Mustache.Compile (mustache)

foo :: Template
foo = [mustache|This is my inline {{ template }} created at compile time|]

Partials are not supported in the QuasiQuoter

valueembedTemplate :: [FilePath] -> FilePath -> Q Exp
#

Compile a mustache Template at compile time providing a search space for any partials. Usage:

{-# LANGUAGE TemplateHaskell #-}
import Text.Mustache.Compile (embedTemplate)

foo :: Template
foo = $(embedTemplate ["dir", "dir/partials"] "file.mustache")

Compile a mustache Template at compile time. Usage:

{-# LANGUAGE TemplateHaskell #-}
import Text.Mustache.Compile (embedSingleTemplate)

foo :: Template
foo = $(embedSingleTemplate "dir/file.mustache")

Partials are not supported in embedSingleTemplate