When comparing Spock vs Nested-Routes, the Slant community recommends Spock for most people. In the question“What are the best Haskell web frameworks for building RESTful web services?” Spock is ranked 2nd while Nested-Routes is ranked 9th. The most important reason people chose Spock is:
Spock parses request URLs into well-typed data without requiring your routes to be declared at the type level.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Type-safe, function-level routes
Spock parses request URLs into well-typed data without requiring your routes to be declared at the type level.
Pro Small but complete
Unlike scotty it manages to be small and, at the same time, includes all the necessities like sessions and db pool.
Pro Embed Attoparsec parsers and regular expressions in a routable url
If you have a data encoding you would like to allow as a path chunk, you can do so by routing with an attoparsec parser or regular expression directly.
Pro Nesting of Handlers
The ability to give a handler child handlers turns a list of handlers into a tree of handlers - much easier to maintain.
Pro Simple and Concise
Routing a RESTful api is very literal in Nested-Routes.
Cons
Con Complicated Types
There is a lot of advanced language extensions in use for the engine - if you have a typo somewhere, the errors are practically impossible to understand.