| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Type-Level Routing for PureScript
Trout is a Servant-style routing type API. By using routing types you get static guarantees about having handled all cases. You also get a lot of stuff for free, such as type-safe parameters for handlers, and automatically generated type-safe URIs to endpoints.
The primary use of Trout right now is for Hyper and the purescript-hypertrout server package. There is, however, nothing Hyper-specific about this package.
bower install --save purescript-troutThis package should get its own proper documentation soon. In the meantime, see purescript-hypertrout.
This library's API documentation is published on Pursuit.
Routes are now named. The following routes are written in the old format, compatible with 0.9.x:
type TestSite =
Resource (Get (HTML :<|> JSON) Home)
:<|> "users" :/ Resource (Get (HTML :<|> JSON) Home)When ported to 0.10.0, they become named:
type TestSite =
"home" := Resource (Get (HTML :<|> JSON) Home)
:<|> "users" := "users" :/ Resource (Get (HTML :<|> JSON) Home)The route name and the literal route segments are orthogonal; there is no relation between the name "users" and the segment "users" in the above routes, as far as Trout is concerned. The name is only used to identify the route when deriving functionality from the routes, e.g. to obtain a URI to a specific resource.
Mozilla Public License Version 2.0
Logo credit: https://commons.wikimedia.org/wiki/File:Lake_Trout_GLERL.jpg
| Back | FazBrowse Home | New Git URL |