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
- data UrlAuthority = UrlAuthority {}
- showUrlAuthority :: UrlAuthority -> String
- data UrlAuthent = UrlAuthent {}
- showUrlAuthent :: UrlAuthent -> String
- 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 :: UrlAuthority -> m a
- type AbsoluteUrl = AbsoluteUrlT Identity
Classes
class MonadUrl base type' m where #
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
showUrlAuthority :: UrlAuthority -> String #
data UrlAuthent #
Constructors
UrlAuthent | |
Fields
|
Instances
showUrlAuthent :: UrlAuthent -> String #
Relative Urls
newtype RelativeUrlT m a #
Constructors
RelativeUrlT | |
Fields
|
Instances
type RelativeUrl = RelativeUrlT Identity #
Grounded Urls
newtype GroundedUrlT m a #
Constructors
GroundedUrlT | |
Fields
|
Instances
type GroundedUrl = GroundedUrlT Identity #
Absolute Urls
newtype AbsoluteUrlT m a #
Constructors
AbsoluteUrlT | |
Fields
|
Instances
type AbsoluteUrl = AbsoluteUrlT Identity #