-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A library for working with URLs.
--   
--   A library for working with URLs.
@package url
@version 2.1.3


-- | Provides a convenient way for working with HTTP URLs. Based on RFC
--   1738. See also: RFC 3986
module Network.URL

-- | A type for working with URL. The parameters are in
--   <tt>application/x-www-form-urlencoded</tt> format:
--   <a>http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1</a>
data URL
URL :: URLType -> String -> [(String, String)] -> URL
[url_type] :: URL -> URLType
[url_path] :: URL -> String
[url_params] :: URL -> [(String, String)]

-- | Different types of URL.
data URLType

-- | Has a host
Absolute :: Host -> URLType

-- | Does not have a host
HostRelative :: URLType

-- | Relative to another URL
PathRelative :: URLType

-- | Contains information about the connection to the host.
data Host
Host :: Protocol -> String -> Maybe Integer -> Host
[protocol] :: Host -> Protocol
[host] :: Host -> String
[port] :: Host -> Maybe Integer

-- | The type of known protocols.
data Protocol
HTTP :: Bool -> Protocol
FTP :: Bool -> Protocol
RawProt :: String -> Protocol

-- | Does this host use a "secure" protocol (e.g., https).
secure :: Host -> Bool

-- | Is this a "secure" protocol. This works only for known protocols, for
--   <a>RawProt</a> values we return <a>False</a>.
secure_prot :: Protocol -> Bool

-- | Convert a URL to a list of "bytes". We represent non-ASCII characters
--   using UTF8.
exportURL :: URL -> String

-- | Convert a list of "bytes" to a URL.
importURL :: String -> Maybe URL

-- | Convert the host part of a URL to a list of "bytes".
exportHost :: Host -> String

-- | Add a (key,value) parameter to a URL.
add_param :: URL -> (String, String) -> URL

-- | Decode a list of "bytes" to a string. Performs % and UTF8 decoding.
decString :: Bool -> String -> Maybe String

-- | Convert a string to bytes by escaping the characters that do not
--   satisfy the input predicate. The first argument specifies if we should
--   replace spaces with +.
encString :: Bool -> (Char -> Bool) -> String -> String
ok_host :: Char -> Bool

-- | Characters that do not need to be encoded in URL
ok_url :: Char -> Bool
ok_param :: Char -> Bool

-- | Characters that can appear non % encoded in the path part of the URL
ok_path :: Char -> Bool
exportParams :: [(String, String)] -> String
importParams :: String -> Maybe [(String, String)]
instance GHC.Classes.Eq Network.URL.Host
instance GHC.Classes.Eq Network.URL.Protocol
instance GHC.Classes.Eq Network.URL.URL
instance GHC.Classes.Eq Network.URL.URLType
instance GHC.Classes.Ord Network.URL.Host
instance GHC.Classes.Ord Network.URL.Protocol
instance GHC.Classes.Ord Network.URL.URL
instance GHC.Classes.Ord Network.URL.URLType
instance GHC.Internal.Show.Show Network.URL.Host
instance GHC.Internal.Show.Show Network.URL.Protocol
instance GHC.Internal.Show.Show Network.URL.URL
instance GHC.Internal.Show.Show Network.URL.URLType
