Yesod: The Full-Stack Veteran
Yesod is a mature, 'batteries-included' web framework that prioritizes developer productivity and compile-time safety. It is built on the philosophy of using Haskell’s strong type system to prevent common
web vulnerabilities like cross-site scripting (XSS) and ensure URL integrity. With features like declarative routing, automatic database migrations via the Persistent library, and a powerful templating system called Shakespeare, Yesod gives you everything needed to build complex, high-performance web applications out of the box. It is an excellent choice for developers who want a robust, opinionated framework that guides them toward building secure and scalable sites.
Servant: For Type-Safe APIs
Servant isn't a framework in the traditional sense; it's a library for declaring web APIs at the type level. This means your API's structure—its endpoints, parameters, and return types—is encoded directly in Haskell's type system. The major benefit is that if your code compiles, your API implementation matches its specification, eliminating a whole class of runtime errors. Servant can automatically generate client functions and documentation from the same API type, ensuring your frontend and backend are always in sync. It's the perfect choice for building microservices or any application where API correctness is paramount.
IHP: The Modern, Fast-Paced Framework
IHP, or Integrated Haskell Platform, is a newer, full-stack framework that aims to bring the rapid development experience of Ruby on Rails or Django to the Haskell ecosystem. It is highly opinionated and comes with everything you need, including a built-in schema designer, code generation, and live reloading. IHP is designed to be accessible even to those new to Haskell, abstracting away much of the complexity to let developers focus on building features. Its killer feature is the tight integration between the database and the type system; changes to your database schema are automatically reflected in your Haskell code, ensuring end-to-end type safety.
Scotty: The Lightweight Minimalist
Inspired by Ruby's Sinatra, Scotty is a lightweight web framework ideal for writing simple REST APIs and smaller web services. Its API is minimal and intuitive, making it incredibly easy to get started without a steep learning curve. Scotty is built on top of WAI and Warp, the standard Haskell web interface and server, which ensures it is fast and efficient. While it lacks the 'batteries-included' nature of Yesod or IHP, its simplicity is its strength. It gives developers the freedom to choose their own libraries for tasks like database access and templating, making it a great fit for projects that don't need a full-blown framework.
Snap: The Modular Component-Based Framework
The Snap Framework is another long-standing player in the Haskell web space, designed for speed and modularity. It consists of a core web server and a set of components called 'Snaplets' that provide additional functionality like session management and authentication. This modular architecture allows you to build up your application by composing independent pieces. Snap also features a powerful templating system called Heist, which allows for a clean separation of presentation and logic. It strikes a balance between the minimalism of Scotty and the all-in-one nature of Yesod, offering a solid foundation that can be extended as needed.
Spock: A Step Up from Scotty
Spock can be seen as a close relative of Scotty but with a richer feature set and a slightly more opinionated structure. It provides more built-in tools for managing state, sessions, and database connections while maintaining a lightweight feel. Spock is designed to be flexible, supporting both traditional server-side rendered applications and modern JSON APIs. For developers who start with Scotty but find they need more structure and built-in functionality without committing to a large framework, Spock offers a perfect middle ground.
WAI and Warp: The Foundation
For the ultimate minimalist who wants full control, you can bypass frameworks entirely and build directly on WAI and Warp. WAI (Web Application Interface) is the standard interface that separates Haskell web applications from web servers, similar to Rack in Ruby. Warp is the high-performance, de facto standard web server that runs WAI applications. Nearly every Haskell framework, including Yesod, Servant, and Scotty, uses WAI and Warp under the hood. Building directly with these tools gives you maximum performance and flexibility, but it means you are responsible for handling everything from routing to response generation yourself.








