HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulemustache-2.4.3.1Haskell2010

Text.Mustache.Compile

Synopsis
  • 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.

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

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