{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Main where import Data.Function ((&)) import Data.Text (Text) import Web.Scotty (ActionM, scotty, get, html) import Text.Blaze.Html.Renderer.Text (renderHtml) import Text.Hamlet (shamlet, hamlet) import Text.Blaze.Html (Html) import Text.Blaze (Markup) import Data.Monoid (mconcat) render :: Html -> ActionM () render = html . renderHtml main :: IO () main = scotty 3000 $ get "/" $ render homepage data Person = Person { _name :: Text , _twitter :: Text , _website :: Text , _books :: [Book] } data Book = Book { _title :: Text , _author :: Text , _link :: Text } allPeople = [ Person { _name = "Joe Rogan" , _twitter = "joerogan" , _website = "joerogan.com" , _books = [ Book {_title = "Food of the Gods" , _author = "fixme" , _link = "fixme" } , Book { _title = "The War of Art" , _author ="fixme" , _link ="fixme" } ] } ] displayPerson person = [shamlet|

#{_name person}