Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Equal = Equal Text
- data Fetch a = Fetch
- class CaptureElem a where
- type Capture as = All CaptureElem as
- type family CaptureResult bf as :: [*]
- capture' :: Capture as => SList as -> [Text] -> SList xs -> Maybe (SList (CaptureResult xs as))
- capture :: (Capture as, Monad m) => SList as -> ApiaryT (CaptureResult xs as) m b -> ApiaryT xs m b
Documentation
class CaptureElem a where Source
CaptureElem Equal | |
Param a => CaptureElem (Fetch a) |
type Capture as = All CaptureElem as Source
type family CaptureResult bf as :: [*] Source
type CaptureResult bf ([] *) = bf | |
type CaptureResult bf ((:) * a as) = CaptureResult (Next a bf) as |
capture' :: Capture as => SList as -> [Text] -> SList xs -> Maybe (SList (CaptureResult xs as)) Source
capture :: (Capture as, Monad m) => SList as -> ApiaryT (CaptureResult xs as) m b -> ApiaryT xs m b Source
low level (without Template Haskell) capture. since 0.4.2.0
myCapture :: SList '[Equal, Fetch Int, Fetch String] myCapture = Equal "path" ::: (Fetch :: Fetch Int) ::: (Fetch :: Fetch String) ::: SNil capture myCapture . stdMethod GET . action $ age name -> do yourAction