Yesod vs wai-routes
When comparing Yesod vs wai-routes, the Slant community recommends Yesod for most people. In the question“What are the best Haskell web frameworks for building RESTful web services?” Yesod is ranked 1st while wai-routes is ranked 6th. The most important reason people chose Yesod is:
While not required, Yesod offers templating through a Shakespearean family of languages to produce page code.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Offers templating for type-safe, well-formed content
While not required, Yesod offers templating through a Shakespearean family of languages to produce page code.
Pro Uses type-safe URLs
Ensures that data provided by the URL is type-safe. This means that data in the URL has a definitive type.
Pro Can be used without knowing much Haskell
While Yesod is written in Haskell, developers can achieve basic functionality without much investment in the language.
Pro Provides type-safe routes
Automatically maps routes to datatypes which are checked at compile time. It uses Template Haskell to reduce boilerplate.
Pro Freely mix "unrouted" handlers with typesafe routing and middleware
Can be used without any routing or Template Haskell. "Unrouted" handlers can be freely mixed and matched with typed routing and middleware.
Pro Easy to customise
Wai-routes is extremely easy to customise. It's neutral to other parts of the system such as the templating language, or the wai server being used. Wai-routes only targets and provides full access to the wai API. The wai-routes handlers are also simple functions which are passed the request data and the environment and return a Response in IO. Arbitrary middleware, routes, and handlers can be mixed together to construct an application.
Pro Lightweight
Performs quite well when compared with other Haskell web frameworks.
Pro Subsites support
Subsites provide encapsulation and ability compile time enforcement of contracts between main site and subsites.
Pro Provides nested routes
Nested routes allow reduction of boilerplate code.
Pro Route annotations
Route annotations provide an easy way to "mark" routes for extra processing.
Cons
Con Is hard to customize
Learning how Yesod works internally is hard. It is a large framework with complicated components. Finding the appropriate code and understanding how it contributes to the framework is difficult, meaning developers will struggle.
Con Too much template haskell
You actually want to code in haskell and not some DSL with "magic" hidden under the bonnet.
Con Learning curve
Even though it's a "micro" framework, it has a steep learning curve when using advanced features such as subsites.