6 newtype Title = Title { getTitle :: String }
7 newtype Byline = Byline { getByline :: Maybe String }
8 newtype BodyHtml = BodyHtml { getBodyHtml :: String }
10 instance Show Title where
13 instance Show Byline where
14 show (Byline (Just bl)) = bl
15 show (Byline Nothing ) = ""
17 instance Show BodyHtml where
20 instance XHTML Title where
21 to_xhtml (Title t) = "<h2>" ++ t ++ "</h2>"
23 instance XHTML Byline where
24 to_xhtml (Byline (Just bl)) = "<p><em>" ++ bl ++ "</em></p>"
25 to_xhtml (Byline Nothing) = ""
27 instance XHTML BodyHtml where
28 to_xhtml = getBodyHtml
30 data Article = Article { title :: Title,
32 body_html :: BodyHtml }
34 instance XHTML Article where
35 to_xhtml (Article t bl b) =