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

Safe HaskellNone
LanguageHaskell2010

Web.Routing.SafeRouting

Documentation

data RouteHandle m a #

Constructors

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

newtype HVectElim' x ts #

Constructors

HVectElim' 

Fields

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

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

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

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

data PathInternal (as :: [*]) where #

Instances
Monad m => MonadReader (PathInternal ([] :: [*])) (RegistryT n b middleware reqTypes m) # 
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 #

Instances
Functor PathMap # 
Instance details

Defined in Web.Routing.SafeRouting

Methods

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

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

Semigroup (PathMap x) # 
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) # 
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) # 
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 #

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

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

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

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

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

parse :: PathInternal as -> [Text] -> Maybe (HVect as) #