Operational Dynamics
Technology, Strategy, and IT Operations Consulting   |   Open Source Research and Development   |   Blogs

The web problem, and solving it from Haskell

An initial look at the Snap Framework and its templating engine, Heist

This was first delivered as a talk at fp-syd, the Functional Programming Special Interest Group, Sydney, 20 Sep 12. There aren't speaker notes but to provide a bit of context about what we were talking about, the slides have been annotated with comments about some of the themes we discussed. Some versions of Firefox show a black screen for the first slide on initial load; press Right, PageDown, or Spacebar and it should work; Left or PageUp will take you back a slide.

Presentation, first slide


Is functional programming a good place to do web applications? Hard to say. The trick is to know why the web problem is a mess, how different frameworks approach solving it, and realize the trade-offs you make when choosing one. Turning to Haskell, we'll look at Snap, one of several Haskell web frameworks available, and its templating engine, Heist. To illustrate some of the basics, we'll walk through a small but surprisingly comprehensive application built using Snap. From there we'll talk about the unexpected directions the architecture of the web is taking us these days, and speculate whether we actually need templating much, if all.

As for functional programming, really, we don't get there in this talk. But we've laid the groundwork, bridging from the corseness of a web request to glorious purity of functional code. Next time we can look at the importance of composition, how the Snap authors are realizing this with their notion Snaplets, and how you can leverage it to achieve reusability in your code.

These documents copyright © 2012 Operational Dynamics Consulting, Pty Ltd unless otherwise noted. Copyright of work by other authors is retained by those authors. Most material in this site is made available under an Open Source or Open Content licence; see the top level LICENCE file in that project's source repository for details

Files on this site (notably program code) will be delivered as Content-Type: text/plain unless syntax-highlighted or binary. Optimized for standards. All times UTC