O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Install blaze-from-html using stack. Here we use the resolver lts-9.1. Feel free to use the latest or your favorite resolver:
        stack --resolver lts-9.1 install blaze-from-html
  1. Check the location of the tool using stack:
        stack path --local-bin
  1. Use curl to download the home page from haskell.org (http://www.haskell.org/):
       curl -X GET http://www.haskell.org -o index.html
  1. Use blaze-from-html to engineer the blaze DSL from the HTML page:
        blaze-from-html -v html5 -s index.html > index.hs
  1. You will need to tweak the code.
  2. Correct the encoding of the copyright message in the footer class (find the code H.div ! class_ "footer"). Find the message "2014-2017 haskell.org". Either correct the encoding or remove the characters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required