on master help sign in
clarify some variable names in the examples + semantic html pedantry
13edc01Alp Mestanogullari
servant-examples/tutorial/T4.hs+7−7
@@ -25,11 +25,11 @@ instance ToJSON Person
25
25
26-- HTML serialization of a single person
26-- HTML serialization of a single person
27instance ToHtml Person where
27instance ToHtml Person where
28− toHtml p =
28+ toHtml person =
29 tr_ $ do
29 tr_ $ do
30− td_ (toHtml $ firstName p)
30+ td_ (toHtml $ firstName person)
31− td_ (toHtml $ lastName p)
31+ td_ (toHtml $ lastName person)
32− td_ (toHtml . show $ age p)
32+ td_ (toHtml . show $ age person)
33
33
34 toHtmlRaw = toHtml
34 toHtmlRaw = toHtml
35
35
@@ -37,9 +37,9 @@ instance ToHtml Person where
37instance ToHtml [Person] where
37instance ToHtml [Person] where
38 toHtml persons = table_ $ do
38 toHtml persons = table_ $ do
39 tr_ $ do
39 tr_ $ do
40− td_ "first name"
40+ th_ "first name"
41− td_ "last name"
41+ th_ "last name"
42− td_ "age"
42+ th_ "age"
43
43
44 foldMap toHtml persons
44 foldMap toHtml persons
45
45