nested-routes-7.0.0: Declarative, compositional Wai responses

Copyright(c) 2015 Athan Clark
LicenseBSD-style
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Web.Routes.Nested.Match

Contents

Description

 

Synopsis

Path Combinators

origin_ :: UrlChunks `[]` Source

The Origin chunk - the equivalent to []

literal_ :: Text -> EitherUrlChunk Nothing Source

Match against a Literal chunk

f_ :: Text -> EitherUrlChunk (Just Text) Source

file_ :: Text -> EitherUrlChunk (Just Text) Source

Removes file extension from the matched route

p_ :: Text -> Parser r -> EitherUrlChunk (Just r) Source

parse_ :: Text -> Parser r -> EitherUrlChunk (Just r) Source

Match against a Parsed chunk, with attoparsec.

r_ :: Text -> Regex -> EitherUrlChunk (Just [String]) Source

regex_ :: Text -> Regex -> EitherUrlChunk (Just [String]) Source

Match against a Regular expression chunk, with regex-compat.

pred_ :: Text -> (Text -> Maybe r) -> EitherUrlChunk (Just r) Source

Match with a predicate against the url chunk directly.

(</>) :: EitherUrlChunk mx -> UrlChunks xs -> UrlChunks (mx : xs) infixr 9 Source

Prefix a routable path by more predicative lookup data.

Path Types

type EitherUrlChunk = PathChunk Text Source

Constrained to AttoParsec, Regex-Compat and T.Text

type UrlChunks = PathChunks Text Source

Container when defining route paths