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

Safe HaskellNone
LanguageHaskell2010

Web.Routing.Combinators

Synopsis

Documentation

data PathState #

Constructors

Open 
Closed 

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

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 ~ Open) => IsString (Path a pathState) # 
Instance details

Defined in Web.Routing.Combinators

Methods

fromString :: String -> Path a pathState #

toInternalPath :: Path as pathState -> PathInternal as #

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

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

A route parameter

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

A static route piece

root :: Path '[] Open #

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

wildcard :: Path '[Text] Closed #

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 #

pathToRep :: Path as ps -> Rep as #