Skip to content

Instantly share code, notes, and snippets.

View yogeshsajanikar's full-sized avatar

Yogesh Sajanikar yogeshsajanikar

  • Pune, India
View GitHub Profile
@sebfisch
sebfisch / gist:3757918
Created September 20, 2012 19:43
Comparing Snap's and Yesod's Template Languages Heist and Hamlet

Comparing Snap's and Yesod's Template Languages Heist and Hamlet - and HSP

Currently, Snap and Yesod are the two most active web frameworks for Haskell. In this document, I compare the template languages used by those frameworks for generating HTML.

Both template languages let programmers write markup directly in a markup language rather than generating it from within Haskell. Compared with static HMTL, template languages support substitution to dynamically determine parts of the content of the generated page.

[Heist] and [Hamlet] support different constructs to generate content dynamically. They also differ regarding their syntax for static content.

@mscharley
mscharley / Generator.re
Last active January 19, 2022 02:45
Example of using JavaScript generators in ReasonML.
/* Note, this is only for library interop code. This is *not* a good way to do things in pure Reason code. */
module type GeneratorType {
type value('a);
type t('a);
type fn('a) = unit => t('a);
let valueGet: value('a) => option('a);
let doneGet: value('a) => bool;