Presenting results in an HTML web page

Sharing data online is one of the quickest ways to reach a broad audience. However, typing data into HTML directly can be time consuming. This recipe will generate a web page using the Blaze Haskell library to present data results. For more documentation and tutorials, visit the project webpage at http://jaspervdj.be/blaze/.

Getting ready

Install the Blaze package from cabal using the following command:

$ cabal install blaze-html

How to do it…

In a new file called Main.hs, perform the following steps:

  1. Import all the necessary libraries as follows:
    {-# LANGUAGE OverloadedStrings #-} import Control.Monad (forM_) import Text.Blaze.Html5 import qualified Text.Blaze.Html5 as H import Text.Blaze.Html.Renderer.Utf8 (renderHtml) ...

Get Haskell Data Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.