| Copyright | (c) 2015 2016 2017 2018 Athan Clark |
|---|---|
| License | BSD-style |
| Maintainer | athan.clark@gmail.com |
| Stability | experimental |
| Portability | GHC |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Web.Routes.Nested.Types
Description
Synopsis
- 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 urlbase m a = VerbListenerT (FileExtListenerT urlbase m a) m a
- action :: MonadBaseControl IO m stM => Extractable stM => ActionT urlbase 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.
Constructors
| Tries | |
Fields
| |
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".
Constructors
| RouterT | |
Fields
| |
Instances
| MonadTrans (RouterT x sec) Source # | |
Defined in Web.Routes.Nested.Types | |
| Monad m => MonadState (Tries x sec) (RouterT x sec m) Source # | |
| MonadIO m => MonadIO (RouterT x sec m) Source # | |
Defined in Web.Routes.Nested.Types | |
| Monad m => Applicative (RouterT x sec m) Source # | |
Defined in Web.Routes.Nested.Types Methods pure :: a -> RouterT x sec m a # (<*>) :: RouterT x sec m (a -> b) -> RouterT x sec m a -> RouterT x sec m b # liftA2 :: (a -> b -> c) -> RouterT x sec m a -> RouterT x sec m b -> RouterT x sec m c # (*>) :: RouterT x sec m a -> RouterT x sec m b -> RouterT x sec m b # (<*) :: RouterT x sec m a -> RouterT x sec m b -> RouterT x sec m a # | |
| Functor m => Functor (RouterT x sec m) Source # | |
| Monad m => Monad (RouterT x sec m) Source # | |
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 urlbase m a = VerbListenerT (FileExtListenerT urlbase m a) m a Source #
The type of "content" builders; using the wai-middleware-verbs and wai-middleware-content-type packages.
action :: MonadBaseControl IO m stM => Extractable stM => ActionT urlbase 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.