shakespeare-js- Stick your haskell variables into javascript/coffeescript at compile time.

Safe HaskellNone




A Shakespearean module for Roy, introducing type-safe, compile-time variable and url interpolation. It is exactly the same as Text.Julius, except that the template is first compiled to Javascript with the system tool roy.

To use this module, roy must be installed on your system.

Unfortunately variable interpolation in Roy does not currently work, but it can with a small change to Roy:

Further reading:

  1. Shakespearean templates:
  2. Roy: http://



Template-Reading Functions

These QuasiQuoter and Template Haskell methods return values of type JavascriptUrl url. See the Yesod book for details.

roy :: QuasiQuoterSource

Read inline, quasiquoted Roy.

royFile :: FilePath -> Q ExpSource

Read in a Roy template file. This function reads the file once, at compile time.

royFileReload :: FilePath -> Q ExpSource

Read in a Roy template file. This impure function uses unsafePerformIO to re-read the file on every call, allowing for rapid iteration.