When comparing Happstack Lite vs wai-routes, the Slant community recommends Happstack Lite for most people. In the question“What are the best Haskell web frameworks for building RESTful web services?” Happstack Lite is ranked 4th while wai-routes is ranked 6th. The most important reason people chose Happstack Lite is:
There is extensive documentation and tutorials for Happstack and Happstack Lite available for use. Documentation and tutorials help programmers write their code; with so many options, programmers will have an easy time learning the framework.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Has extensive documentation
There is extensive documentation and tutorials for Happstack and Happstack Lite available for use. Documentation and tutorials help programmers write their code; with so many options, programmers will have an easy time learning the framework.
Pro Molded through 7+ years of feedback
Happstack has been around for over seven years. During this time developers used the framework and offered feedback to improve it. As a result, it is stable and unlikely to have major changes. Happstack Lite was created from all of this feedback
Pro Shares all of its components on gitHub
Having open source means that developers can customize the framework and offer suggestions and solutions to the code.
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 Handles exceptions poorly
When an exception occurs on the server, the error gets printed. By seeing an error that makes no sense to the user, his experience is negatively impacted. Having a negative experience can mean a user never visits the site again.
Con Allows bad code by not enforcing logic separation
Happstack allows developers to write code for controllers, routing, and models together. Doing so will dirty the code and make maintenance harder.
Con Learning curve
Even though it's a "micro" framework, it has a steep learning curve when using advanced features such as subsites.