evancz/Elm — pull request #15 by tazjin (2012-05-30 19:58:12+00:00)
Title: * new Shakespearean Elm templates

Greg Weber has kindly created a Shakespearean QuasiQuoter for Elm, it supports variable and type-safe URL interpolation.

As a result of this, the following new types and classes have been introduced:

Elm :: Elm is a newtype wrapper around Data.Text.Lazy.Builder which
contains Elm source code

ElmUrl url :: ElmUrl is a type synonym for a function that renders Elm
with interpolated type-safe URLs.

ToElm a :: ToElm is a type class which contains variables that can be
interpolated in the Elm QuasiQuoters

ElmSource a :: ElmSource is a type class which contains all types
currently understood by the Elm compilation functions, toParts and
toHtml

-----
elm-yesod has been updated to support URL interpolation. This is not yet done using a ToWidget instance, as those seem to depend on private types and functions from the hidden Yesod.Internal module. For now this is a marginal usage difference:

With ToWidget instance:
defaultLayout $ toWidget [elm|....|]

With elmWidget function:
widget <- elmWidget [elm| ... |]
defaultLayout $ widget

This might change in the future (I consider it possible that I just missed something when digging around in the ToWidget type class)