saferoute-0.2.0.0: A simple type-safe routing library.

Portabilityarchlinux
Stabilityexperimental
MaintainerPeter Harpending <pharpend2@gmail.com>
Safe HaskellNone

Web.Saferoute

Description

 

Synopsis

Documentation

type Route = TextSource

The type for a route - just an alias for Text

class Eq r => Resource r whereSource

The type class for a resource.

Methods

getRoute :: r -> RouteSource

resourceList :: [r]Source

A list of all of the constructors for your resource type.

routeResourceMap :: Map Route rSource

A map from a route to it's resource.

lookupRoute :: Route -> Maybe rSource

Given a Route, find the Resource behind it. If the route isn't associated with any Resource, this returns Nothing.

getUrl :: r -> AttributeValueSource

Given a Resource, get the URL for it.