reroute-0.6.0.0: abstract implementation of typed and untyped web routing
Safe HaskellNone
LanguageHaskell2010

Web.Routing.SafeRouting

Documentation

data RouteHandle m a Source #

Constructors

forall as. 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

Instances details
Monad m => MonadReader (PathInternal ('[] :: [Type])) (RegistryT n b middleware reqTypes m) Source # 
Instance details

Defined in Web.Routing.Router

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

Instances details
Functor PathMap Source # 
Instance details

Defined in Web.Routing.SafeRouting

Methods

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

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

Semigroup (PathMap x) Source # 
Instance details

Defined in Web.Routing.SafeRouting

Methods

(<>) :: PathMap x -> PathMap x -> PathMap x #

sconcat :: NonEmpty (PathMap x) -> PathMap x #

stimes :: Integral b => b -> PathMap x -> PathMap x #

Monoid (PathMap x) Source # 
Instance details

Defined in Web.Routing.SafeRouting

Methods

mempty :: PathMap x #

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

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

NFData x => NFData (PathMap x) Source # 
Instance details

Defined in Web.Routing.SafeRouting

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 #