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

Web.Routing.SafeRouting

Documentation

data RouteHandle (m :: Type -> Type) a Source #

Constructors

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

newtype HVectElim' x (ts :: [Type]) Source #

Constructors

HVectElim' 

Fields

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

defRoute :: forall (xs :: [Type]) m a. 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 :: [Type]) where Source #

Constructors

PI_Empty :: PathInternal ('[] :: [Type]) 
PI_StaticCons :: forall (as :: [Type]). Text -> PathInternal as -> PathInternal as 
PI_VarCons :: forall a (as1 :: [Type]). (FromHttpApiData a, Typeable a) => PathInternal as1 -> PathInternal (a ': as1) 
PI_Wildcard :: forall (as1 :: [Type]). PathInternal as1 -> PathInternal (Text ': as1) 

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 ('[] :: [Type])) #

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

reader :: (PathInternal ('[] :: [Type]) -> 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 #

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 #

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 #

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

Defined in Web.Routing.SafeRouting

Methods

rnf :: PathMap x -> () #

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

insertPathMap' :: forall (ts :: [Type]) x. PathInternal ts -> (HVect ts -> x) -> PathMap x -> PathMap x Source #

singleton :: forall (ts :: [Type]) x. PathInternal ts -> HVectElim ts x -> PathMap x Source #

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

insertSubComponent' :: forall (ts :: [Type]) x. 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 #

(</!>) :: forall (as :: [Type]) (bs :: [Type]). PathInternal as -> PathInternal bs -> PathInternal (Append as bs) Source #

parse :: forall (as :: [Type]). PathInternal as -> [Text] -> Maybe (HVect as) Source #