nested-routes-7.2.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

o_ :: UrlChunks `[]`

origin_ :: UrlChunks `[]`

The Origin chunk - the equivalent to []

literal_ :: Text -> EitherUrlChunk Nothing

Match against a Literal chunk

f_ :: Text -> EitherUrlChunk (Just Text)

file_ :: Text -> EitherUrlChunk (Just Text)

Removes file extension from the matched route

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

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

Match against a Parsed chunk, with attoparsec.

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

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

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

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

Match with a predicate against the url chunk directly.

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

Prefix a routable path by more predicative lookup data.

Path Types

type EitherUrlChunk = PathChunk Text

Constrained to AttoParsec, Regex-Compat and T.Text

type UrlChunks = PathChunks Text

Container when defining route paths