~ubuntu-branches/ubuntu/vivid/haskell-blaze-html/vivid

« back to all changes in this revision

Viewing changes to Text/Blaze.hs

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2012-01-26 20:15:49 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120126201549-jpd87031jzlt03y0
Tags: 0.4.3.1-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
--
20
20
-- > page1 :: Html
21
21
-- > page1 = html $ do
 
22
-- >     head $ do
 
23
-- >         title "Introduction page."
 
24
-- >         link ! rel "stylesheet" ! type_ "text/css" ! href "screen.css"
 
25
-- >     body $ do
 
26
-- >         div ! id "header" $ "Syntax"
 
27
-- >         p "This is an example of BlazeHtml syntax."
 
28
-- >         ul $ mapM_ (li . toHtml . show) [1, 2, 3]
22
29
--
23
30
-- The resulting HTML can now be extracted using:
24
31
--
73
73
    , (!)
74
74
    ) where
75
75
 
 
76
import Data.Monoid (mconcat)
 
77
 
76
78
import Data.Text (Text)
77
79
import qualified Data.Text.Lazy as LT
78
80
 
89
91
    toHtml = id
90
92
    {-# INLINE toHtml #-}
91
93
 
 
94
instance ToHtml [Html] where
 
95
    toHtml = mconcat
 
96
    {-# INLINE toHtml #-}
 
97
 
92
98
instance ToHtml Text where
93
99
    toHtml = text
94
100
    {-# INLINE toHtml #-}