| Copyright | 2014, Peter Harpending. |
|---|---|
| License | BSD3 |
| Maintainer | Peter Harpending <pharpend2@gmail.com> |
| Stability | experimental |
| Portability | archlinux |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Skell.Saferoute
Description
- type Route = Text
- class Eq r => Resource r where
- getRoute :: r -> Route
- resourceList :: [r]
- routeResourceMap :: Map Route r
- lookupRoute :: Route -> Maybe r
- getUrl :: Resource r => r -> AttributeValue
- slashPrependJoin :: [Text] -> Text
Documentation
class Eq r => Resource r where Source
The type class for a resource.
Minimal complete definition
Methods
resourceList :: [r] Source
A list of all of the constructors for your resource type.
routeResourceMap :: Map Route r Source
A map from a route to it's resource.
lookupRoute :: Route -> Maybe r Source
Given a Route, find the Resource behind it. If the route
isn't associated with any Resource, this returns Nothing.
getUrl :: Resource r => r -> AttributeValue Source
slashPrependJoin :: [Text] -> Text Source
Intercalate slashes, and add one to the front