-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Memory efficient url type and parser. -- -- Memory efficient url type and parser library using the Bytes type from -- byteverse. @package url-bytes @version 0.1.0.0 module Url.Unsafe -- | Url type represented by its serialization, and slices of that -- serialization. -- -- Syntax in pseudo-BNF: -- --
-- url = scheme ":" [ hierarchical | non-hierarchical ] [ "?" query ]? [ "#" fragment ]? -- non-hierarchical = non-hierarchical-path -- non-hierarchical-path = * Does not start with "" */ -- hierarchical = authority? hierarchical-path -- authority = "//" userinfo? host [ ":" port ]? -- userinfo = username [ ":" password ]? "@" -- hierarchical-path = [ "/" path-segment ]+ --data Url Url :: {-# UNPACK #-} !Bytes -> !Int# -> !Int# -> !Int# -> !Int# -> !Int# -> !Int# -> !Int# -> !Int# -> Url [urlSerialization] :: Url -> {-# UNPACK #-} !Bytes -- | Before ':' [urlSchemeEnd] :: Url -> !Int# -- | Before ':' (if a password is given) or '@' (if not) [urlUsernameEnd] :: Url -> !Int# [urlHostStart] :: Url -> !Int# [urlHostEnd] :: Url -> !Int# [urlPort] :: Url -> !Int# -- | Before initial '/', if any [urlPathStart] :: Url -> !Int# -- | Before '?' [urlQueryStart] :: Url -> !Int# -- | Before '#' [urlFragmentStart] :: Url -> !Int# -- | Possible parse errors data ParseError EndOfInput :: ParseError InvalidAuthority :: ParseError InvalidPort :: ParseError instance GHC.Show.Show Url.Unsafe.ParseError instance GHC.Classes.Ord Url.Unsafe.ParseError instance GHC.Classes.Eq Url.Unsafe.ParseError instance GHC.Show.Show Url.Unsafe.Url instance GHC.Classes.Ord Url.Unsafe.Url instance GHC.Classes.Eq Url.Unsafe.Url -- | Note: this library parses, but does not validate urls module Url -- | Url type represented by its serialization, and slices of that -- serialization. -- -- Syntax in pseudo-BNF: -- --
-- url = scheme ":" [ hierarchical | non-hierarchical ] [ "?" query ]? [ "#" fragment ]? -- non-hierarchical = non-hierarchical-path -- non-hierarchical-path = * Does not start with "" */ -- hierarchical = authority? hierarchical-path -- authority = "//" userinfo? host [ ":" port ]? -- userinfo = username [ ":" password ]? "@" -- hierarchical-path = [ "/" path-segment ]+ --data Url -- | Possible parse errors data ParseError EndOfInput :: ParseError InvalidAuthority :: ParseError InvalidPort :: ParseError -- | Decode a hierarchical URL decodeUrl :: Bytes -> Either ParseError Url -- | Slice into the Url and retrieve the scheme, if it's present getScheme :: Url -> Maybe Bytes -- | Slice into the Url and retrieve the username, if it's present getUsername :: Url -> Maybe Bytes getAuthority :: Url -> Maybe Bytes getPassword :: Url -> Maybe Bytes -- | Slice into the Url and retrieve the host, if it's present getHost :: Url -> Maybe Bytes -- | Slice into the Url and retrieve the path starting with -- '/', if it's present getPath :: Url -> Maybe Bytes -- | Slice into the Url and retrieve the query string starting with -- '?', if it's present getQuery :: Url -> Maybe Bytes -- | Slice into the Url and retrieve the fragment starting with -- '#', if it's present getFragment :: Url -> Maybe Bytes -- | This function is intentionally imprecise. E.g. getExtension -- "google.com/facebook.com" == Just ".com" getExtension :: Url -> Maybe Bytes getPort :: Url -> Maybe Word16 constructUrl :: Maybe String -> String -> Maybe Word16 -> String -> [(String, String)] -> Maybe String -> Q (TExp Url) literalUrl :: String -> Q (TExp Url)