Copyright | (c) 2015 Athan Clark |
---|---|
License | BSD-style |
Maintainer | athan.clark@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
- data Tries x s = Tries {
- trieContent :: !(RootedPredTrie Text x)
- trieCatchAll :: !(RootedPredTrie Text x)
- trieSecurity :: !(RootedPredTrie Text s)
- trieContentMutable :: (Typeable x, Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text x)
- trieCatchAllMutable :: (Typeable x, Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text x)
- trieSecurityMutable :: (Typeable s', Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text s')
- newtype RouterT x sec m a = RouterT {
- runRouterT :: StateT (Tries x sec) m a
- execRouterT :: Monad m => RouterT x sec m a -> m (Tries x sec)
- type ActionT m a = VerbListenerT (FileExtListenerT m a) m a
- action :: Monad m => ActionT m () -> MiddlewareT m
- type ExtrudeSoundly xs' xs c r = (xs' ~ CatMaybes xs, ArityTypeListIso c xs' r, Extrude (UrlChunks xs) (RootedPredTrie Text c) (RootedPredTrie Text r))
Internal Structure
data Tries x s
The internal data structure built during route declaration.
Tries | |
|
trieContentMutable :: (Typeable x, Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text x)
trieCatchAllMutable :: (Typeable x, Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text x)
trieSecurityMutable :: (Typeable s', Typeable s) => Tries x s' -> ST s (RootedHashTableTrie s Text s')
Builder
newtype RouterT x sec m a
The (syntactic) monad for building a router with functions like
"Web.Routes.Nested.match".
it should have a shape of RouterT (MiddlewareT m) (SecurityToken s) m a
when used with "Web.Routes.Nested.route".
RouterT | |
|
execRouterT :: Monad m => RouterT x sec m a -> m (Tries x sec)
Run the monad, only getting the built state and throwing away a
.
type ActionT m a = VerbListenerT (FileExtListenerT m a) m a
The type of "content" builders; using the wai-middleware-verbs and wai-middleware-content-type packages.
action :: Monad m => ActionT m () -> MiddlewareT m
Run the content builder into a middleware that responds when the content
is satisfiable (i.e. Accept
headers are O.K., etc.)
Book Keeping
type ExtrudeSoundly xs' xs c r = (xs' ~ CatMaybes xs, ArityTypeListIso c xs' r, Extrude (UrlChunks xs) (RootedPredTrie Text c) (RootedPredTrie Text r))
Soundness constraint showing that a function's arity can be represented as a type-level list.