reroute-0.5.0.0: abstract implementation of typed and untyped web routing

Safe HaskellNone
LanguageHaskell2010

Web.Routing.Combinators

Synopsis

Documentation

data PathState Source #

Constructors

Open 
Closed 

data Path (as :: [*]) (pathState :: PathState) where Source #

Constructors

Empty :: Path '[] Open 
StaticCons :: Text -> Path as ps -> Path as ps 
VarCons :: (FromHttpApiData a, Typeable a) => Path as ps -> Path (a ': as) ps 
Wildcard :: Path as Open -> Path (Text ': as) Closed 

Instances

((~) [*] a ([] *), (~) PathState pathState Open) => IsString (Path a pathState) Source # 

Methods

fromString :: String -> Path a pathState #

toInternalPath :: Path as pathState -> PathInternal as Source #

type Var a = Path (a ': '[]) Open Source #

var :: (Typeable a, FromHttpApiData a) => Path (a ': '[]) Open Source #

A route parameter

static :: String -> Path '[] Open Source #

A static route piece

root :: Path '[] Open Source #

The root of a path piece. Use to define a handler for "/"

wildcard :: Path '[Text] Closed Source #

Matches the rest of the route. Should be the last part of the path.

(</>) :: Path as Open -> Path bs ps2 -> Path (Append as bs) ps2 Source #

pathToRep :: Path as ps -> Rep as Source #