# Yesod: A Haskell Web Framework Built on WAI

> Yesod is a RESTful Haskell web framework layered on top of WAI, with routing declared through Template Haskell and compile-time safety as its core claim. It suits teams already committed to Haskell, and it asks a lot from everyone else.

**yesodweb/yesod** — A RESTful Haskell web framework built on WAI.

- Repository: https://github.com/yesodweb/yesod
- Website: http://www.yesodweb.com/
- Stars: 2,726 · Forks: 386
- Language: Haskell
- License: MIT
- Published: 2026-09-28 · Updated: 2026-09-28 · Language: en
- Canonical page: https://hysenlabs.com/projects/yesodweb-yesod

## What Yesod Solves for Haskell Web Developers

Haskell gives you strong types and compiled performance, but it does not hand you a web stack. Yesod fills that gap: it is a RESTful web framework built on WAI, and it bundles routing, handlers, templating through Shakespeare, forms, persistence and testing into a single set of packages. The README frames the pitch in four points: safety and security guaranteed at compile time, developer productivity through tools that cover basic web development needs, raw performance from compiled code and techniques for constant-space memory consumption, and asynchronous IO inherited from the language itself.

The audience is narrow and specific. This is for developers who already write Haskell and want a framework that treats the type system as a feature rather than an obstacle. If you are coming from Rails, Django or Express and hoping Yesod will be a gentler introduction to functional programming, the routing example alone should tell you otherwise: it uses quasiquotes and Template Haskell, so the framework's syntax is inseparable from the language's extension system.

## How Routing and Handlers Work in Yesod

The mechanism is visible in the minimal example the README gives. You declare a data type for your application, run mkYesod over a quasiquoted block of routes, and the framework generates the route types and the typeclass instances for you. Each line in that block maps a path to a resource name and an HTTP method. The HomeR GET line means a GET request to the root path is handled by a function named getHomeR, and the naming convention is what connects the two: the handler prefix plus the resource name plus the method.

Handlers run in the Handler monad, which carries the application type and produces a response body. defaultLayout wraps that body in the site's layout, and the whamlet quasiquote compiles the markup at build time. The warp call in main starts the server on port 3000 with the App value as the foundation, which is where the README suggests you keep configuration and database connection pools. The layering matters: WAI sits underneath as the interface, and Yesod is the framework on top, which is why the project is split across yesod-core, wai, persistent and shakespeare as separate repositories.

## Installing Yesod and Running a First Handler

The README does not give an install command for the framework itself. It points to the quick start guide on the project website, which it says is based on the Haskell build tool stack, and that is the path to follow. For hacking on Yesod itself, the README lists four repositories to clone with submodules, each buildable with stack build:

```bash
git clone --recurse-submodules http://github.com/yesodweb/shakespeare
git clone --recurse-submodules http://github.com/yesodweb/persistent
git clone --recurse-submodules http://github.com/yesodweb/wai
git clone --recurse-submodules http://github.com/yesodweb/yesod
```

Once you have a project from the quick start guide, the minimal application in the README is the smallest thing that runs. It enables OverloadedStrings, QuasiQuotes, TemplateHaskell and TypeFamilies, defines an empty App, declares one route, and serves it:

```haskell
{-# LANGUAGE OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies #-}

import Yesod

data App = App

mkYesod "App" [parseRoutes|
/ HomeR GET
|]

instance Yesod App

getHomeR :: Handler Html
getHomeR = defaultLayout [whamlet|Hello World!|]

main :: IO ()
main = warp 3000 App
```

What you should see is a server on port 3000 answering a GET to the root path with an HTML page containing the text Hello World. The README directs readers to the Basics chapter of the Yesod book for routing, handlers, linking and JSON in more detail.

## Where Yesod Gets in the Way

The compile-time safety claim is real, and so is its cost. Template Haskell and quasiquotes mean your routes and templates are generated during compilation, so a mistake in a route block surfaces as a build error rather than a runtime 404. That is the trade: slower builds and error messages that point into generated code. Teams without Haskell experience will find this harder to debug than a framework where routes are plain strings.

The Dockerfile in the repository is a further signal about the project's age profile. It is built on haskell:7.10, installs stackage-cli and stackage-update, and describes itself as intended as a development environment, not a deployment artifact. The README does not document a supported deployment path, and it does not document rollback, migrations or upgrade procedures for the framework itself. No recent releases were retrieved, so there is no version history to consult. If you need a framework with a documented release cadence and a migration guide between versions, this is the wrong tool.

## Yesod Compared with Scotty and Servant

The closest comparisons in the Haskell web space are Scotty and Servant, and the difference is architectural rather than cosmetic. Scotty is a thin layer over WAI: you write routes and handlers as ordinary Haskell functions, with no Template Haskell and no generated types, which keeps builds fast and errors readable but gives you no compile-time checking that your links match your routes. Servant goes the other direction, encoding your API as a type-level description so that handlers are checked against it and client functions can be derived from the same description; it is a strong fit when the API is the product.

Yesod sits between them and adds more than routing. It brings forms, persistence through persistent, templating through Shakespeare, and a test package, which is why the project spans four repositories rather than one. The cost of that breadth is that you adopt a whole stack, not a router. If all you want is to expose a few JSON endpoints in Haskell, Servant or Scotty will ask less of you.

## Maintenance, Licensing and the Cost of Upgrading

The repository is not archived, and the last push was on 2026-09-18. The README does not describe a release process, a support window or a compatibility policy, and no recent releases were retrieved, so there is nothing here to tell you how often the framework changes or how painful an upgrade is. What the README does show is that Yesod is not one package: yesod-core, yesod-auth, yesod-form, yesod-static, yesod-test, yesod-websockets and others sit at the top level of the repository, alongside persistent, wai and shakespeare as separate clones. An upgrade therefore means moving a set of interdependent packages together, and the stack.yaml and stack-lts-22.yaml files at the top level are the pinned snapshots that define a working combination.

The licence is MIT, which is permissive and places few conditions on redistribution or modification. That is a statement about the licence text, not legal advice; if you are shipping Yesod inside a product, have your own counsel read the LICENSE file rather than relying on a summary.

## Conclusion

Adopt Yesod if your team already writes Haskell and wants routing, type-safe URLs and persistence in one coherent stack; skip it if your team has no Haskell experience, because the compile-time guarantees only pay off if you can read the compiler errors. Before committing, verify the quick start guide on the project site still matches the stack-based workflow the README recommends, and confirm which sub-repositories you actually need, since yesod-core, persistent and wai are cloned and built separately.

## FAQ

### What is Yesod?

Yesod is a RESTful Haskell web framework built on WAI. The README describes it as an advanced web framework featuring compile-time safety, developer productivity tools, compiled performance with constant-space memory techniques, and asynchronous IO inherited from Haskell.

### How do I install Yesod?

The README does not give a direct install command. It recommends the quick start guide on the project website, which it says is based on the Haskell build tool stack. For working on Yesod itself, the README lists four repositories to clone with submodules, each buildable with stack build.

### What does the minimal Yesod application look like?

The README's example defines an App type, declares one route with mkYesod and parseRoutes, implements getHomeR to render Hello World through defaultLayout and whamlet, and starts the server with warp 3000 App.

### Which repositories make up Yesod?

The README says Yesod consists mostly of four repositories: shakespeare, persistent, wai and yesod. The top level of the yesod repository also contains packages such as yesod-core, yesod-auth, yesod-form, yesod-static and yesod-test.

### What licence does Yesod use?

The repository licence is MIT. The README itself does not discuss licensing terms.

## Sources

- [Issues](https://github.com/yesodweb/yesod/issues)
- [License: MIT](https://github.com/yesodweb/yesod/blob/master/LICENSE)
- [Project website](http://www.yesodweb.com/)
- [README](https://github.com/yesodweb/yesod/blob/master/README.md)
- [yesodweb/yesod on GitHub](https://github.com/yesodweb/yesod)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/yesodweb-yesod
