nested-routes-6.0.0: Declarative, compositional Wai responses

Safe HaskellNone
LanguageHaskell2010

Web.Routes.Nested.Types

Synopsis

Documentation

class Singleton chunks a trie | chunks a -> trie where Source

Creates a string of nodes - a trie with a width of 1.

Methods

singleton :: chunks -> a -> trie Source

Instances

(Singleton (UrlChunks xs) a trie0, Extend (EitherUrlChunk x) trie0 trie1) => Singleton (UrlChunks ((:) (Maybe *) x xs)) a trie1 Source 
Singleton (UrlChunks ([] (Maybe *))) a (RootedPredTrie Text a) Source 

class Extend eitherUrlChunk child result | eitherUrlChunk child -> result where Source

Turn a list of tries (Rooted) into a node with those children

Methods

extend :: eitherUrlChunk -> child -> result Source

Instances

Extend (EitherUrlChunk (Just * r)) (RootedPredTrie Text (r -> a)) (RootedPredTrie Text a) Source

Existentially quantified case

Extend (EitherUrlChunk (Nothing *)) (RootedPredTrie Text a) (RootedPredTrie Text a) Source

Literal case

class Extrude chunks start result | chunks start -> result where Source

FoldR Extend start chunks ~ result

Methods

extrude :: chunks -> start -> result Source

Instances

(Extrude (UrlChunks xs) trie0 trie1, Extend (EitherUrlChunk x) trie1 trie2) => Extrude (UrlChunks ((:) (Maybe *) x xs)) trie0 trie2 Source 
Extrude (UrlChunks ([] (Maybe *))) (RootedPredTrie Text a) (RootedPredTrie Text a) Source 

type family CatMaybes xs :: [*] Source

Equations

CatMaybes `[]` = `[]` 
CatMaybes (Nothing : xs) = CatMaybes xs 
CatMaybes (Just x : xs) = x : CatMaybes xs