| Copyright | (c) Athan L. Clark |
|---|---|
| License | MIT |
| Maintainer | Athan L. Clark <athan.clark@gmail.com> |
| Stability | experimental |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Url
Description
This library helps us distinguish how we present URLs - we might show them
relatively, absolutely (with the URI authority - scheme, port, hostname, etc.),
or grounded - where the path begins with /.
We leverage Chris Done's path library to distinguish relative vs. grounded paths at compile time, and provide some additional features like a file extension and query parameters in path-extra.
- class MonadUrl base type' m where
- newtype RelativeUrlT m a = RelativeUrlT {
- runRelativeUrlT :: m a
- type RelativeUrl = RelativeUrlT Identity
- newtype GroundedUrlT m a = GroundedUrlT {
- runGroundedUrlT :: m a
- type GroundedUrl = GroundedUrlT Identity
- newtype AbsoluteUrlT m a = AbsoluteUrlT {
- runAbsoluteUrlT :: URIAuth -> m a
- type AbsoluteUrl = AbsoluteUrlT Identity
- mkUriPath :: URIAuth -> Path base type' -> URI
- mkUriPathEmpty :: Path base type' -> URI
- mkUriLoc :: URIAuth -> Location base type' -> URI
- mkUriLocEmpty :: Location base type' -> URI
Classes
class MonadUrl base type' m where Source #
Turns a Path or Location into a String, where the rendering behavior
(relative, grounded and absolute) is encoded in the monad you use, much like
LoggingT and NoLoggingT from monad-logger.
Instances
Types
Relative Urls
newtype RelativeUrlT m a Source #
Constructors
| RelativeUrlT | |
Fields
| |
Instances
type RelativeUrl = RelativeUrlT Identity Source #
Grounded Urls
newtype GroundedUrlT m a Source #
Constructors
| GroundedUrlT | |
Fields
| |
Instances
type GroundedUrl = GroundedUrlT Identity Source #
Absolute Urls
newtype AbsoluteUrlT m a Source #
Constructors
| AbsoluteUrlT | |
Fields
| |
Instances
type AbsoluteUrl = AbsoluteUrlT Identity Source #
mkUriPathEmpty :: Path base type' -> URI Source #
mkUriLocEmpty :: Location base type' -> URI Source #