This fast-moving guide introduces web application development with Haskell and Yesod, a potent language/framework combination that supports high-performing applications that are modular, type-safe, and concise. Fully updated for Yesod 1.4, this second edition shows you how Yesod handles widgets, forms, persistence, and RESTful content. Author Michael Snoyman also introduces various Haskell tools to supplement your basic knowledge of the language.
By the time you finish this book, you’ll create a production-quality web application with Yesod’s ready-to-use scaffolding. You’ll also examine several real-world examples, including a blog, a wiki, a JSON web service, and a Sphinx search server.
Build a simple application to learn Yesod’s foundation datatype and Web Application Interface (WAI)
Get an indepth look at Yesod’s core monads for producing cleaner, more modular code
Probe Yesod’s internal workings: learn the request handling process for a typical application
Build forms on top of widgets by implementing the yesod-form declarative API
Learn how Yesod and Haskell handle persistence and session data
Serve an HTML page and a machine-friendly JSON page from the same URL
Developing Web Apps with Haskell and Yesod, 2nd Edition
Michael Snoyman, creator of Yesod, has been programming for about 15 years, using Haskell for the past five. 5. He brings ten years of web development experience in a wide variety of environments as well as time spent creating documentation.
The animals on the cover of Developing Web Apps with Haskell and Yesod, Second Editionare a common rhinoceros beetle (Xylotrupes ulysses) and an Apollo butterfly(Parnassius apollo).
Common rhinoceros beetles are famous for their size and unique head shape—themales possess a set of large horns, one pointing from the top of the head and anotherfrom the center of the thorax. These horns are used to fight other males for matingrights, and also to dig in search of food. The size of the horn relative to the body is agood indication of physical health and nutrition.
Male rhinoceros beetles can reach up to six inches in length, and this large size providesprotection from most predators. However, these beetles cannot bite or sting,which makes them popular pets in some Asian countries. Their violent bids forfemale attention also make them widely used for gambling fights.
The Apollo butterfly is a beautiful white butterfly with black spots on the forewingsand red eyespots on the hindwings. The size, placement, and shade of these spots canvary depending on the region the butterfly is from. This makes them a very attractivespecies to collectors, who endeavor to capture one of each variant.
These butterflies are native to Europe, and can be found as far east as central Asia.They prefer a habitat of mountain meadows that contain many nectar-providingflowers and rocky outcroppings for cocoon formation.
Due in part to over-collecting, but mostly to habitat loss, these butterflies are listed as“vulnerable” on the IUCN Red List. There are laws in place to restrict trade of individualApollo butterflies, but more conservation needs to be done to prevent furtherloss of habitat. Climate change, acid rain, and urbanization are all contributing factorsto the displacement of this species, but thankfully countries like Poland and Germanyhave small groups of conservationists working to protect their localpopulations.