nested-routes-10.0.0: Declarative, compositional Wai responses
Copyright(c) 2015 2016 2017 2018 Athan Clark
LicenseBSD-style
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Routes.Nested.Match

Description

 
Synopsis

Path Combinators

origin_ :: UrlChunks '[] Source #

The Origin chunk - the equivalent to []

literal_ :: Text -> EitherUrlChunk 'Nothing Source #

Match against a Literal chunk

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

Removes file extension from the matchedhttp:/hackage.haskell.orgpackage/nested-routes route

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

Match against a Parsed chunk, with attoparsec.

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

class ToUrlChunks a (xs :: [Maybe *]) | a -> xs where Source #

Methods

toUrlChunks :: a -> UrlChunks xs Source #