diff options
author | Johannes Gerer <oss@johannesgerer.com> | 2016-10-27 02:18:13 +0200 |
---|---|---|
committer | Johannes Gerer <oss@johannesgerer.com> | 2016-10-27 02:18:13 +0200 |
commit | 95eb4d6a041305a27dc8fcd42ff1831d9961b7a3 (patch) | |
tree | 3433db574dc8d074354ae70232d29a9cb81ba136 /src/Readme.hs | |
parent | 675085c2e0b0b851378da08b7d73024766107c87 (diff) | |
download | blazeT-95eb4d6a041305a27dc8fcd42ff1831d9961b7a3.tar.gz blazeT-95eb4d6a041305a27dc8fcd42ff1831d9961b7a3.tar.zst blazeT-95eb4d6a041305a27dc8fcd42ff1831d9961b7a3.zip |
Docsv0.0.1
Diffstat (limited to 'src/Readme.hs')
-rw-r--r-- | src/Readme.hs | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | |||
3 | import Data.Time (getCurrentTime) | ||
4 | import Text.BlazeT.Html5 hiding (main) | ||
5 | import Text.BlazeT.Renderer.String | ||
6 | import Control.Monad.Trans.Class (lift) | ||
7 | |||
8 | -- Backwords compatible Blaze HTML | ||
9 | old :: Markup | ||
10 | old = do | ||
11 | p $ "created with blaze-html" | ||
12 | |||
13 | -- BlazeT HTML with lifted IO actions | ||
14 | new :: MarkupT IO () | ||
15 | new = do | ||
16 | time <- lift getCurrentTime | ||
17 | p $ string $ "created with blazeT at " ++ show time | ||
18 | |||
19 | main :: IO () | ||
20 | main = do | ||
21 | putStrLn $ renderMarkup old | ||
22 | putStrLn =<< execWith renderMarkup new | ||
23 | |||