Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ema.Route.Url
Contents
Synopsis
- routeUrl :: HasCallStack => Prism' FilePath r -> r -> Text
- routeUrlWith :: HasCallStack => UrlStrategy -> Prism' FilePath r -> r -> Text
- data UrlStrategy
- urlToFilePath :: Text -> FilePath
Create URL from route
routeUrl :: HasCallStack => Prism' FilePath r -> r -> Text Source #
Like routeUrlWith
but uses UrlDirect
strategy
routeUrlWith :: HasCallStack => UrlStrategy -> Prism' FilePath r -> r -> Text Source #
data UrlStrategy Source #
How to produce URL paths from routes
Constructors
UrlPretty | Use pretty URLs. The route encoding "foobar.html" produces "foobar" as URL. |
UrlDirect | Use filepaths as URLs. The route encoding "foobar.html" produces "foobar.html" as URL. |
Instances
FromJSON UrlStrategy Source # | |
Defined in Ema.Route.Url | |
Generic UrlStrategy Source # | |
Defined in Ema.Route.Url Associated Types type Rep UrlStrategy :: Type -> Type # | |
Show UrlStrategy Source # | |
Defined in Ema.Route.Url Methods showsPrec :: Int -> UrlStrategy -> ShowS # show :: UrlStrategy -> String # showList :: [UrlStrategy] -> ShowS # | |
Eq UrlStrategy Source # | |
Defined in Ema.Route.Url | |
Ord UrlStrategy Source # | |
Defined in Ema.Route.Url Methods compare :: UrlStrategy -> UrlStrategy -> Ordering # (<) :: UrlStrategy -> UrlStrategy -> Bool # (<=) :: UrlStrategy -> UrlStrategy -> Bool # (>) :: UrlStrategy -> UrlStrategy -> Bool # (>=) :: UrlStrategy -> UrlStrategy -> Bool # max :: UrlStrategy -> UrlStrategy -> UrlStrategy # min :: UrlStrategy -> UrlStrategy -> UrlStrategy # | |
type Rep UrlStrategy Source # | |
urlToFilePath :: Text -> FilePath Source #