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)
- 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 => MonadBaseControl IO m stM => Extractable stM => 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
The internal data structure built during route declaration.
Tries | |
|
Builder
newtype RouterT x sec m a Source #
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) Source #
Run the monad, only getting the built state and throwing away a
.
type ActionT m a = VerbListenerT (FileExtListenerT m a) m a Source #
The type of "content" builders; using the wai-middleware-verbs and wai-middleware-content-type packages.
action :: Monad m => MonadBaseControl IO m stM => Extractable stM => ActionT m () -> MiddlewareT m Source #
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)) Source #
Soundness constraint showing that a function's arity can be represented as a type-level list.