In [1]:
2+3
In [2]:
{-# LANGUAGE OverloadedStrings #-}
In [3]:
import Control.Monad (forM_)
In [4]:
import Text.Blaze.Html5 as H
In [5]:
import Text.Blaze.Html5.Attributes as A
In [7]:
numbers :: Int -> Html
numbers n = docTypeHtml $ do
H.head $ do
H.title "Natural numbers"
body $ do
p "A list of natural numbers:"
ul $ forM_ [1 .. n] (li . toHtml)
In [8]:
numbers 3
In [13]:
import Text.Blaze.Renderer.Pretty
import Text.Blaze.Renderer.String
In [14]:
Text.Blaze.Renderer.String.renderHtml $ numbers 3
In [ ]: