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

Copyright2014, Peter Harpending.
LicenseBSD3
MaintainerPeter Harpending <pharpend2@gmail.com>
Stabilityexperimental
Portabilityarchlinux
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Saferoute

Description

 

Synopsis

Documentation

type Route = Text Source

The type for a route - just an alias for Text

class Eq r => Resource r where Source

The type class for a resource.

Minimal complete definition

getRoute, (resourceList | routeResourceMap)

Methods

getRoute :: r -> Route Source

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.