nested-routes-0.3.1: Declarative, compositional Wai responses

Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Routes.Nested.Types.UrlChunks

Synopsis

Documentation

data EitherUrlChunk x where Source

Constrained to AttoParsec & T.Text

Constructors

(:=) :: Text -> EitherUrlChunk Nothing 
(:~) :: (Text, Parser r) -> EitherUrlChunk (Just r) 

Instances

Extend (EitherUrlChunk (Nothing *)) (RUPTrie Text a) (RUPTrie Text a) 
Extend (EitherUrlChunk (Just * r)) (RUPTrie Text (r -> a)) (RUPTrie Text a) 

p :: (Text, Parser r) -> EitherUrlChunk (Just r) Source

data UrlChunks xs where Source

Container when defining route paths

Constructors

Cons :: EitherUrlChunk mx -> UrlChunks xs -> UrlChunks (mx : xs) 
Root :: UrlChunks [] 

Instances

ToL (UrlChunks xs) => ToL (UrlChunks ((:) (Maybe *) (Nothing *) xs)) 
ToL (UrlChunks ([] (Maybe *))) 
ToNE (UrlChunks ((:) (Maybe *) (Nothing *) ([] (Maybe *)))) 
ToNE (UrlChunks xs) => ToNE (UrlChunks ((:) (Maybe *) (Nothing *) xs)) 
(Extrude (UrlChunks xs) trie0 trie1, Extend (EitherUrlChunk x) trie1 trie2) => Extrude (UrlChunks ((:) (Maybe *) x xs)) trie0 trie2 
(Singleton (UrlChunks xs) a trie0, Extend (EitherUrlChunk x) trie0 trie1) => Singleton (UrlChunks ((:) (Maybe *) x xs)) a trie1 
Singleton (UrlChunks ([] (Maybe *))) a (RUPTrie Text a) 
Extrude (UrlChunks ([] (Maybe *))) (RUPTrie Text a) (RUPTrie Text a) 

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