The hamlet package

Hamlet gives you a type-safe tool for generating HTML code. It works via Quasi-Quoting, and generating extremely efficient output code. The syntax is white-space sensitive, and it helps you avoid cross-site scripting issues and 404 errors. Please see the documentation at http://docs.yesodweb.com/book/hamlet/ for more details.

As a quick overview, here is a sample Hamlet template (note that, due to some issues with Haddock, I have replaced braces ({ and }) with double-square-brackets ([[ and ]])):