Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PathState
- data Path (as :: [*]) (pathState :: PathState) where
- toInternalPath :: Path as pathState -> PathInternal as
- type Var a = Path (a ': '[]) 'Open
- data AltVar a b
- var :: (Typeable a, FromHttpApiData a) => Path (a ': '[]) 'Open
- static :: String -> Path '[] 'Open
- root :: Path '[] 'Open
- wildcard :: Path '[Text] 'Closed
- (</>) :: Path as 'Open -> Path bs ps2 -> Path (Append as bs) ps2
- pathToRep :: Path as ps -> Rep as
- renderRoute :: AllHave ToHttpApiData as => Path as 'Open -> HVect as -> Text
- renderRoute' :: AllHave ToHttpApiData as => Path as 'Open -> HVect as -> [Text]
Documentation
data Path (as :: [*]) (pathState :: PathState) where Source #
toInternalPath :: Path as pathState -> PathInternal as Source #
A variant of Either
with a FromHttpApiData
definition that tries both branches without a prefix.
Useful to define routes with var
s that should work with different types.
Instances
(Eq a, Eq b) => Eq (AltVar a b) Source # | |
(Ord a, Ord b) => Ord (AltVar a b) Source # | |
(Read a, Read b) => Read (AltVar a b) Source # | |
(Show a, Show b) => Show (AltVar a b) Source # | |
(FromHttpApiData a, FromHttpApiData b) => FromHttpApiData (AltVar a b) Source # | |
Defined in Web.Routing.Combinators parseUrlPiece :: Text -> Either Text (AltVar a b) # parseHeader :: ByteString -> Either Text (AltVar a b) # |
wildcard :: Path '[Text] 'Closed Source #
Matches the rest of the route. Should be the last part of the path.
renderRoute :: AllHave ToHttpApiData as => Path as 'Open -> HVect as -> Text Source #
renderRoute' :: AllHave ToHttpApiData as => Path as 'Open -> HVect as -> [Text] Source #