Safe Haskell | None |
---|
- (</>) :: UrlPat -> UrlPat -> UrlPat
- grabInt :: Text -> UrlPat
- grabText :: Text -> UrlPat
- pT :: Text -> UrlPat
- pS :: String -> UrlPat
- patRoute :: Maybe Text -> StdMethod -> UrlPat -> WhebHandlerT g s m -> Route g s m
- compilePat :: UrlPat -> UrlParser
- rootPat :: UrlPat
- getParam :: Typeable a => Text -> RouteParamList -> Maybe a
- matchUrl :: [Text] -> UrlParser -> Maybe RouteParamList
- generateUrl :: UrlParser -> RouteParamList -> Either UrlBuildError Text
- findUrlMatch :: StdMethod -> [Text] -> [Route g s m] -> Maybe (WhebHandlerT g s m, RouteParamList)
- testUrlParser :: UrlParser -> RouteParamList -> Bool
URL building
(</>) :: UrlPat -> UrlPat -> UrlPatSource
Allows for easier building of URL patterns This should be the primary URL constructor.
(\"blog\" '</>' ('grabInt' \"pk\") '</>' \"edit\" '</>' ('grabText' \"verb\"))
Convenience constructors
URL Patterns
Working with URLs
getParam :: Typeable a => Text -> RouteParamList -> Maybe aSource
Lookup and cast a URL parameter to its expected type if it exists.
generateUrl :: UrlParser -> RouteParamList -> Either UrlBuildError TextSource
Runs a UrlParser
with RouteParamList
to a URL path
findUrlMatch :: StdMethod -> [Text] -> [Route g s m] -> Maybe (WhebHandlerT g s m, RouteParamList)Source
Sort through a list of routes to find a Handler and RouteParamList
Utilities
testUrlParser :: UrlParser -> RouteParamList -> BoolSource
Test a parser to make sure it can match what it produces and vice versa