{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module BigTable.Hamlet where import Criterion (Benchmark, bench, nf) import Data.Text.Lazy (Text) import Text.Blaze.Html.Renderer.Text (renderHtml) import Text.Hamlet import Weigh bigTable :: [[Int]] -> Text bigTable rows = renderHtml $ [hamlet|
i am good at lots of static data
i am glab at lots of static data
i am glob at lots of static data
i am glib at lots of static data
i am glub at lots of static data
i am glom at lots of static data
i am glof at lots of static data
i am gref at lots of static data
i am greg at lots of static data
#{i} |
---|
hi! #{col} hello! i am good at lots of static data i am glab at lots of static data i am glob at lots of static data i am glib at lots of static data i am glub at lots of static data i am glom at lots of static data i am glof at lots of static data i am gref at lots of static data i am greg at lots of static data|] () where header = [1..10 :: Int] benchmark :: [[Int]] -> Benchmark benchmark rows = bench "hamlet" (bigTable `nf` rows) weight :: [[Int]] -> Weigh () weight i = func (show (length i) ++ "/hamlet") bigTable i |