This is a talk that I gave at the 2012-06-22 BFPG meetup. In this repo you may find the slides and all of the source code used during the presentation.
Yesod is a very interesting web framework written in Haskell that tries to leverage the haskell type system as much as possible to reduce common errors during development. In this talk we will explore this type safety and also how the boilerplate burden of these types are largely hidden by the yesod metaprogramming functions.
- Install the Haskell Platform.
- cabal install virthualenv
- In this directory, run: “virthualenv”
- “source .virthualenv/bin/activate”
- “cabal install yesod persistent-sqllite”
- Run any of these haskell files with “runhaskell <file>” to get the example up and running.
These examples show yesod at its simplest. One route with no database cruft to get in the way of the fundamentals. The expanded files are simply the same file as the non-expanded ones, just with (a very cleaned up) version of the expanded code in place of the metaprogramming calls.
This example shows most things that you want to see in a webapp (sans sessions and auth) while still keeping true to the single file example.
The broken file show the note route in the middle of a refactor, showing what type errors the compiler picks up after this route change.