From 95eb4d6a041305a27dc8fcd42ff1831d9961b7a3 Mon Sep 17 00:00:00 2001 From: Johannes Gerer Date: Thu, 27 Oct 2016 02:18:13 +0200 Subject: Docs --- src/Readme.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/Readme.hs (limited to 'src/Readme.hs') diff --git a/src/Readme.hs b/src/Readme.hs new file mode 100644 index 0000000..3ccabad --- /dev/null +++ b/src/Readme.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE OverloadedStrings #-} + +import Data.Time (getCurrentTime) +import Text.BlazeT.Html5 hiding (main) +import Text.BlazeT.Renderer.String +import Control.Monad.Trans.Class (lift) + +-- Backwords compatible Blaze HTML +old :: Markup +old = do + p $ "created with blaze-html" + +-- BlazeT HTML with lifted IO actions +new :: MarkupT IO () +new = do + time <- lift getCurrentTime + p $ string $ "created with blazeT at " ++ show time + +main :: IO () +main = do + putStrLn $ renderMarkup old + putStrLn =<< execWith renderMarkup new + -- cgit v1.2.3