Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Normal form where on handler search API is traversed in tree like facion without retraversal of the paths.
Synopsis
- data TreeApi a
- = WithStaticPath [Text] (TreeApi a)
- | WithCapturePath [Text] (TreeApi a)
- | SwitchApi (Maybe a) (Map Text (TreeApi a)) (Maybe (CaptureCase a))
- data CaptureCase a = CaptureCase {}
- getPath :: [Text] -> TreeApi a -> Maybe (a, CaptureMap)
- toTreeApi :: Api a -> TreeApi a
Documentation
This form of API encodes path switch points as Map's so it does not retraverse the routes and can find the right branch on switch. In the plain api it tries the routes one by one until it finds the right one.
WithStaticPath [Text] (TreeApi a) | |
WithCapturePath [Text] (TreeApi a) | |
SwitchApi (Maybe a) (Map Text (TreeApi a)) (Maybe (CaptureCase a)) |
data CaptureCase a Source #
Capture case alternative
Instances
Functor CaptureCase Source # | |
Defined in Mig.Core.Api.NormalForm.TreeApi fmap :: (a -> b) -> CaptureCase a -> CaptureCase b # (<$) :: a -> CaptureCase b -> CaptureCase a # | |
Show a => Show (CaptureCase a) Source # | |
Defined in Mig.Core.Api.NormalForm.TreeApi showsPrec :: Int -> CaptureCase a -> ShowS # show :: CaptureCase a -> String # showList :: [CaptureCase a] -> ShowS # | |
Eq a => Eq (CaptureCase a) Source # | |
Defined in Mig.Core.Api.NormalForm.TreeApi (==) :: CaptureCase a -> CaptureCase a -> Bool # (/=) :: CaptureCase a -> CaptureCase a -> Bool # |