mig-0.2.1.0: Build lightweight and composable servers
Safe HaskellSafe-Inferred
LanguageGHC2021

Mig.Core.Api.NormalForm.TreeApi

Description

Normal form where on handler search API is traversed in tree like facion without retraversal of the paths.

Synopsis

Documentation

data TreeApi a Source #

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.

Instances

Instances details
Functor TreeApi Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

Methods

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

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

Show a => Show (TreeApi a) Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

Methods

showsPrec :: Int -> TreeApi a -> ShowS #

show :: TreeApi a -> String #

showList :: [TreeApi a] -> ShowS #

Eq a => Eq (TreeApi a) Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

Methods

(==) :: TreeApi a -> TreeApi a -> Bool #

(/=) :: TreeApi a -> TreeApi a -> Bool #

data CaptureCase a Source #

Capture case alternative

Constructors

CaptureCase 

Fields

Instances

Instances details
Functor CaptureCase Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

Methods

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

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

Show a => Show (CaptureCase a) Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

Eq a => Eq (CaptureCase a) Source # 
Instance details

Defined in Mig.Core.Api.NormalForm.TreeApi

getPath :: [Text] -> TreeApi a -> Maybe (a, CaptureMap) Source #

Get a route by path, also extracts capture map

toTreeApi :: Api a -> TreeApi a Source #

Converts api to tree normal form