| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Dormouse.Url
Synopsis
- data UrlComponents = UrlComponents {}
- data UrlScheme
- data Url (scheme :: Symbol) where
- HttpUrl :: UrlComponents -> Url "http"
- HttpsUrl :: UrlComponents -> Url "https"
- data AnyUrl = forall scheme. AnyUrl (Url scheme)
- ensureHttp :: MonadThrow m => AnyUrl -> m (Url "http")
- ensureHttps :: MonadThrow m => AnyUrl -> m (Url "https")
- parseUrl :: MonadThrow m => ByteString -> m AnyUrl
- parseHttpUrl :: MonadThrow m => ByteString -> m (Url "http")
- parseHttpsUrl :: MonadThrow m => ByteString -> m (Url "https")
- class (Eq url, Show url) => IsUrl url where
Documentation
data UrlComponents Source #
Constructors
| UrlComponents | |
Instances
| Eq UrlComponents Source # | |
Defined in Dormouse.Url.Types Methods (==) :: UrlComponents -> UrlComponents -> Bool # (/=) :: UrlComponents -> UrlComponents -> Bool # | |
| Show UrlComponents Source # | |
Defined in Dormouse.Url.Types Methods showsPrec :: Int -> UrlComponents -> ShowS # show :: UrlComponents -> String # showList :: [UrlComponents] -> ShowS # | |
| Lift UrlComponents Source # | |
Defined in Dormouse.Url.Types | |
Constructors
| HttpScheme | |
| HttpsScheme |
data Url (scheme :: Symbol) where Source #
A Url is defined here as an absolute URI in the http or https schemes. Authority components are requried by the http / https
Uri schemes.
Constructors
| HttpUrl :: UrlComponents -> Url "http" | |
| HttpsUrl :: UrlComponents -> Url "https" |
ensureHttp :: MonadThrow m => AnyUrl -> m (Url "http") Source #
Ensure that the supplied Url uses the _http_ scheme, throwing a UrlException in m if this is not the case
ensureHttps :: MonadThrow m => AnyUrl -> m (Url "https") Source #
Ensure that the supplied Url uses the _https_ scheme, throwing a UrlException in m if this is not the case
parseUrl :: MonadThrow m => ByteString -> m AnyUrl Source #
Parse an ascii ByteString as a url, throwing a UriException in m if this fails
parseHttpUrl :: MonadThrow m => ByteString -> m (Url "http") Source #
Parse an ascii ByteString as an http url, throwing a UriException in m if this fails
parseHttpsUrl :: MonadThrow m => ByteString -> m (Url "https") Source #
Parse an ascii ByteString as an https url, throwing a UriException in m if this fails