nested-routes-7.2.0: Declarative, compositional Wai responses

Copyright(c) 2015 Athan Clark
LicenseBSD-style
Maintainerathan.clark@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Web.Routes.Nested.Types

Contents

Description

 

Synopsis

Internal Structure

data Tries x s

The internal data structure built during route declaration.

Constructors

Tries 

Fields

trieContent :: !(RootedPredTrie Text x)
 
trieCatchAll :: !(RootedPredTrie Text x)
 
trieSecurity :: !(RootedPredTrie Text s)
 

Instances

Monoid (Tries x s) 
Monad m => MonadState (Tries x sec) (RouterT x sec m) 

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".

Constructors

RouterT 

Fields

runRouterT :: StateT (Tries x sec) m a
 

Instances

MonadTrans (RouterT x sec) 
Monad m => MonadState (Tries x sec) (RouterT x sec m) 
Monad m => Monad (RouterT x sec m) 
Functor m => Functor (RouterT x sec m) 
Monad m => Applicative (RouterT x sec m) 
MonadIO m => MonadIO (RouterT x sec m) 

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.