Safe Haskell | None |
---|
This module contains Shakespearean (see Text.Shakespeare) templates for Elm.
It introduces type-safe compile-time variable and URL interpolation. A typeclass
is provided for interpolated variables.
ToElm
Further reading on Shakespearean templates: http://www.yesodweb.com/book/templates
Further reading on Elm: http://elm-lang.org
Functions
Template-Reading Functions
These QuasiQuoters return functions of the type (t ->
where Elm
)t
is the URL rendering function if type-safe URLs are used.
A usage example for both type-safe (Yesod) and standard path segment (Happstack) URLs is provided in the Examples folder in the Git repository.
QuasiQuoter for embedding Elm code inside of Haskell code.
Usage:
[elm|main = plaintext "Some elm code"|]
elmFile :: FilePath -> Q ExpSource
A Template Haskell function for embedding Elm code from external .elm files.
Usage:
$(elmFile "elm_source/index.elm")
elmFileReload :: FilePath -> Q ExpSource
Datatypes
Typeclass for interpolated variables
A typeclass for types that can be interpolated in Elm templates.