reroute-0.4.1.0: abstract implementation of typed and untyped web routing

Safe HaskellNone
LanguageHaskell2010

Web.Routing.SafeRouting

Documentation

data RouteHandle m a Source #

Constructors

RouteHandle (PathInternal as) (HVectElim as (m a)) 

newtype HVectElim' x ts Source #

Constructors

HVectElim' 

Fields

type Registry m a = (PathMap (m a), [[Text] -> m a]) Source #

defRoute :: PathInternal xs -> HVectElim' (m a) xs -> Registry m a -> Registry m a Source #

fallbackRoute :: ([Text] -> m a) -> Registry m a -> Registry m a Source #

matchRoute :: Registry m a -> [Text] -> [m a] Source #

data PathInternal as where Source #

Instances

Monad m => MonadReader (PathInternal ([] *)) (RegistryT n b middleware reqTypes m) # 

Methods

ask :: RegistryT n b middleware reqTypes m (PathInternal [*]) #

local :: (PathInternal [*] -> PathInternal [*]) -> RegistryT n b middleware reqTypes m a -> RegistryT n b middleware reqTypes m a #

reader :: (PathInternal [*] -> a) -> RegistryT n b middleware reqTypes m a #

data PathMap x Source #

Instances

Functor PathMap Source # 

Methods

fmap :: (a -> b) -> PathMap a -> PathMap b #

(<$) :: a -> PathMap b -> PathMap a #

Monoid (PathMap x) Source # 

Methods

mempty :: PathMap x #

mappend :: PathMap x -> PathMap x -> PathMap x #

mconcat :: [PathMap x] -> PathMap x #

NFData x => NFData (PathMap x) Source # 

Methods

rnf :: PathMap x -> () #

updatePathMap :: (forall y. (ctx -> y) -> PathMap y -> PathMap y) -> PathInternal ts -> (HVect ts -> ctx -> x) -> PathMap x -> PathMap x Source #

insertPathMap' :: PathInternal ts -> (HVect ts -> x) -> PathMap x -> PathMap x Source #

insertPathMap :: RouteHandle m a -> PathMap (m a) -> PathMap (m a) Source #

insertSubComponent' :: PathInternal ts -> (HVect ts -> [Text] -> x) -> PathMap x -> PathMap x Source #

insertSubComponent :: Functor m => RouteHandle m ([Text] -> a) -> PathMap (m a) -> PathMap (m a) Source #

match :: PathMap x -> [Text] -> [x] Source #