| 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
- type RoutePart = Text
- type RouteParts = [Text]
- type ForeignResource = AttributeValue
- class Eq r => Resource r where
- getRoute :: r -> Route
- resourceList :: [r]
- routeResourceMap :: Map Route r
- lookupRoute :: Route -> Maybe r
- lookupRouteParts :: RouteParts -> Maybe r
- getUrl :: Resource r => r -> AttributeValue
- slashPrependJoin :: RouteParts -> Route
- data ErrorPage
- bootstrapCss :: ForeignResource
- bootstrapJs :: ForeignResource
- jQueryJs :: ForeignResource
Documentation
type RouteParts = [Text] Source
type ForeignResource = AttributeValue Source
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.
lookupRouteParts :: RouteParts -> Maybe r Source
Lookup a set of route parts
getUrl :: Resource r => r -> AttributeValue Source
slashPrependJoin :: RouteParts -> Route Source
Intercalate slashes, and add one to the front