{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -F -pgmFtrhsx #-} module Pages.AppTemplate where import Control.Applicative ((<$>)) import HSP import Happstack.Server (ServerPart, ServerPartT, Response, toResponse) import HSP.ServerPartT () -- instance XMLGenerator (ServerPartT m) import Happstack.Server.HSP.HTML () appTemplate :: ( EmbedAsChild (ServerPartT IO) headers , EmbedAsChild (ServerPartT IO) body ) => String -> headers -> body -> ServerPart Response appTemplate title headers body = toResponse <$> (unXMLGenT (appTemplate' title headers body)) appTemplate' :: ( EmbedAsChild (ServerPartT IO) headers , EmbedAsChild (ServerPartT IO) body ) => String -> headers -> body -> XMLGenT (ServerPartT IO) XML appTemplate' title headers body = <% title %> <% headers %>

Links

14
Feb

Happstack Guestbook

Hey congrats! You're using Happstack. This is a guestbook example which you can freely change to your whims and fancies.

This page is written using Haskell Server Pages (HSP). For an example of a page using HStringTemplate, look at the dynamic README.

Leave a message for the next visitor here...




<% body %>