Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Haskell Cookbook

You're reading from   Haskell Cookbook Build functional applications using Monads, Applicatives, and Functors

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781786461353
Length 396 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Yogesh Sajanikar Yogesh Sajanikar
Author Profile Icon Yogesh Sajanikar
Yogesh Sajanikar
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Foundations of Haskell FREE CHAPTER 2. Getting Functional 3. Defining Data 4. Working with Functors, Applicatives, and Monads 5. More about Monads 6. Working with Common Containers and Strings 7. Working with Relational and NoSQL Databases 8. Working with HTML and Templates 9. Working with Snap Framework 10. Working with Advanced Haskell 11. Working with Lens and Prism 12. Concurrent and Distributed Programming in Haskell

Using blaze to reverse engineer an HTML page

In this recipe, we will use a package blaze-from-html to reverse engineer an existing HTML page, to create Haskell code that uses blaze-html.

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
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image