Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Architecture Views

alsonkemp edited this page · 2 revisions

Views are templates that produce (X)HTML. You write them using:

  1. Special versions of Text.XHtml tags. See the Turbinado.View.XHtml docs.
  2. Well-formed XHTML and special tags (much as with PHP).
  3. HAML-ish code.

Views (as all of Haskell) are white space sensitive.

Turbinado.View.XHtml Tags

… coming soon…

XHtml Tags

… coming soon…


… coming soon…

The ‘markup’ function

All Views must have a markup function. The system automatically looks for the markup function in Views when rendering pages.


For a large example, see the Layout used by the Turbinado website. This Layout includes a helper function within the Layout file.

A simpler example which shows both embedded XHTML and HAML:

import Data.Maybe

          <div style="float:right">
            <img src="" width="300" />
            <% someFunction 1 %>

          <p>Turbinado is an easy-to-use, <% anchorTag "/Home/Performance" "fricking fast" %> web 
            application framework for Haskell (and the <ahref="">Glorious Glasgow 
            Haskell Compiler</a>).  Naturally, this website is written in Turbinado, so head over to the 
            <% anchorTag"" "Git repo" %> to 
            see how easy it is to code websites in Turbinado.</p>

someFunction :: Int -> VHtml
someFunction i =
  %span= show i

In the example above:

  1. Standard-ish HTML markup is used.
  2. Proper whitespace indentation is used.
  3. A call is made to anchorTag to automatically format an anchor tag.
  4. A module is imported (though not used).
  5. A function is defined and it uses HAML for its markup.


trturbinado is a pre-processor that converts XHTML and HAML into valid Turbinado.View.XHtml tags.

Something went wrong with that request. Please try again.