Ticket #1621 (new proposed-project)
Snap: Implement type-safe URL support for the Snap Web Framework
| Reported by: | ozataman | Owned by: | mightybyte |
|---|---|---|---|
| Priority: | not yet rated | Keywords: | snap, web frameworks |
| Cc: | Topic: | Web Development | |
| Difficulty: | unknown | Mentor: | not-accepted |
Description (last modified by mightybyte) (diff)
Snap aims to be a fast, resiable, easy to use, high quality and high level web development framework for Haskell. More information on Snap can be found at http://www.snapframework.com/.
Type safe URLs encode all accessible paths of a web application via an algebraic datatype defined specifically for the web application at hand. All urls within the application, then, are generated from this datatype, which ensures statically that no dead links are present anywhere in the application.
Furthermore, when the user-visible URLs need to change for various (possibly cosmetic) reasons, the change can be implemented centrally and propagated to all the places of use within the application.
The web-routes package on Hackage seems to provide a framework-agnostic way to handle type-safe URLs. However, it might be worthwhile to discuss if this is the right choice for Snap.
The scope of this project would include the following:
- Evaluation of web-routes and development of an idiomatic solution for underlying type-safe URL support for snap, both at "snap-core" and "snap" package levels. The API design should specifically consider how all the pieces will come together given the highly flexible snaplet infrastructure that Snap provides to achieve modularity in web applications.
- Development of Haskell combinators/helpers, so that URLs for various pages can be generated programmatically anywhere in the application.
- Integration with Heist template system so that URLs for various pages, including all necessary parameters, can easily be generated in templates anywhere in the application.
- Development of test cases to be added to the appropriate snap test-suites.
- Implementation of the type-safe URL system for the Snap website, as an initial use case study and verification of the design.
- The project may involve Template Haskell to remove obvious boilerplate.
Interested Mentors
Doug Beardsley
Greg Collins
Ozgun Ataman
