| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Routing.SafeRouting
Synopsis
- data SlashPolicy
- normalizeInternalPath :: forall (as :: [Type]). SlashPolicy -> PathInternal as -> PathInternal as
- data RouteHandle (m :: Type -> Type) a = RouteHandle (PathInternal as) (HVectElim as (m a))
- newtype HVectElim' x (ts :: [Type]) = HVectElim' {
- flipHVectElim :: HVectElim ts x
- type Registry (m :: Type -> Type) a = (PathMap (m a), [[Text] -> m a])
- emptyRegistry :: Registry m a
- defRoute :: forall (xs :: [Type]) m a. 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 :: [Type]) where
- 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)
- PI_Extension :: forall (as1 :: [Type]) (bs :: [Type]). PathInternal as1 -> PathInternal bs -> PathInternal (Append as1 bs)
- PI_Append :: forall (as1 :: [Type]) (bs :: [Type]). PathInternal as1 -> PathInternal bs -> PathInternal (Append as1 bs)
- data PathMap x = PathMap {
- pm_subComponents :: [[Text] -> x]
- pm_here :: [x]
- pm_staticMap :: HashMap Text (PathMap x)
- pm_polyMap :: PolyMap FromHttpApiData PathMap x
- pm_wildcards :: [Text -> x]
- pm_patterns :: [(Int, [Text] -> [x])]
- emptyPathMap :: PathMap x
- orderPatterns :: [(Int, a)] -> [(Int, a)]
- updatePathMap :: forall ctx (ts :: [Type]) x. (forall y. (ctx -> y) -> PathMap y -> PathMap y) -> PathInternal ts -> (HVect ts -> ctx -> x) -> PathMap x -> PathMap x
- insertPathMap' :: forall (ts :: [Type]) x. PathInternal ts -> (HVect ts -> x) -> PathMap x -> PathMap x
- singleton :: forall (ts :: [Type]) x. PathInternal ts -> HVectElim ts x -> PathMap x
- insertPathMap :: RouteHandle m a -> PathMap (m a) -> PathMap (m a)
- insertSubComponent' :: forall (ts :: [Type]) x. 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]
- (</!>) :: forall (as :: [Type]) (bs :: [Type]). PathInternal as -> PathInternal bs -> PathInternal (Append as bs)
- combineRoutePieces :: [Text] -> Text
- parse :: forall (as :: [Type]). PathInternal as -> [Text] -> Maybe (HVect as)
- parsePrefix :: forall (as :: [Type]). PathInternal as -> [Text] -> Maybe (HVect as, [Text])
- extensionSplits :: forall (as :: [Type]). PathInternal as -> Text -> [(Text, Text)]
- dotSplits :: Text -> [(Text, Text)]
- pathPieceCount :: forall (as :: [Type]). PathInternal as -> Int
- pathSpecificity :: forall (as :: [Type]). PathInternal as -> Int
Documentation
data SlashPolicy Source #
How empty path segments are treated. The compatibility default ignores every empty segment. Strict policies preserve internal and trailing slashes. Redirects are performed by the HTTP adapter, using strict registry matching.
Constructors
| IgnoreSlashes | |
| StrictSlashes | |
| RedirectTrailingSlashes |
Instances
| Eq SlashPolicy Source # | |
Defined in Web.Routing.SafeRouting | |
| Read SlashPolicy Source # | |
Defined in Web.Routing.SafeRouting Methods readsPrec :: Int -> ReadS SlashPolicy readList :: ReadS [SlashPolicy] readPrec :: ReadPrec SlashPolicy readListPrec :: ReadPrec [SlashPolicy] | |
| Show SlashPolicy Source # | |
Defined in Web.Routing.SafeRouting Methods showsPrec :: Int -> SlashPolicy -> ShowS show :: SlashPolicy -> String showList :: [SlashPolicy] -> ShowS | |
normalizeInternalPath :: forall (as :: [Type]). SlashPolicy -> PathInternal as -> PathInternal as Source #
data RouteHandle (m :: Type -> Type) a Source #
Constructors
| RouteHandle (PathInternal as) (HVectElim as (m a)) |
newtype HVectElim' x (ts :: [Type]) Source #
Constructors
| HVectElim' | |
Fields
| |
emptyRegistry :: Registry m a Source #
defRoute :: forall (xs :: [Type]) m a. PathInternal xs -> HVectElim' (m a) xs -> 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) | |
| PI_Extension :: forall (as1 :: [Type]) (bs :: [Type]). PathInternal as1 -> PathInternal bs -> PathInternal (Append as1 bs) | |
| PI_Append :: forall (as1 :: [Type]) (bs :: [Type]). PathInternal as1 -> PathInternal bs -> PathInternal (Append as1 bs) |
Instances
| Monad m => MonadReader (PathInternal ('[] :: [Type])) (RegistryT n b middleware reqTypes m) Source | |
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 | |
Constructors
| PathMap | |
Fields
| |
emptyPathMap :: PathMap x Source #
orderPatterns :: [(Int, a)] -> [(Int, a)] Source #
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 #
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 #
(</!>) :: forall (as :: [Type]) (bs :: [Type]). PathInternal as -> PathInternal bs -> PathInternal (Append as bs) Source #
combineRoutePieces :: [Text] -> Text Source #
parsePrefix :: forall (as :: [Type]). PathInternal as -> [Text] -> Maybe (HVect as, [Text]) Source #
extensionSplits :: forall (as :: [Type]). PathInternal as -> Text -> [(Text, Text)] Source #
pathPieceCount :: forall (as :: [Type]). PathInternal as -> Int Source #
pathSpecificity :: forall (as :: [Type]). PathInternal as -> Int Source #