-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate or process x-www-urlencoded data -- -- Generate or process x-www-urlencoded data as it appears in HTTP or -- HTTPS URIs and HTTP POSTs. See -- http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 @package urlencoded @version 0.1 -- | Implements a data type for constructing and destructing -- x-www-urlencoded strings. See -- http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 module Data.URLEncoded -- | A container for URLEncoded data data URLEncoded -- | Create a URLEncoded object that represents all pairs from the input -- that match the supplied predicate filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncoded -- | Serialize a value into a String for encoding as part of an -- x-www-urlencoded value class URLShow a urlShow :: (URLShow a) => a -> String -- | Encode a value as x-www-urlencoded class URLEncode a urlEncode :: (URLEncode a) => a -> URLEncoded -- | URLEncoded data with no pairs empty :: URLEncoded -- | Parse this string as x-www-urlencoded importString :: (MonadError e m) => String -> m URLEncoded -- | Import this list of pairs as URLEncoded data importList :: [(String, String)] -> URLEncoded -- | Create singleton URLEncoded data containing the supplied key and value (%=) :: (URLShow a, URLShow b) => a -> b -> URLEncoded -- | If the second value is Nothing, return empty URLEncoded data. -- Otherwise return singleton URLEncoded data that contains the given key -- and value. (%=?) :: (URLShow a, URLShow b) => a -> Maybe b -> URLEncoded (%&) :: URLEncoded -> URLEncoded -> URLEncoded class AddURLEncoded a (%?) :: (AddURLEncoded a) => a -> URLEncoded -> a -- | Is this URLEncoded data empty? null :: URLEncoded -> Bool -- | All of the keys from the URLEncoded value, in order, preserving -- duplicates keys :: URLEncoded -> [String] lookup :: (URLShow a) => a -> URLEncoded -> Maybe String -- | Return all values whose keys match the supplied key, in the order they -- appear in the query. Will return an empty list if no keys match. lookupAll :: (URLShow a) => a -> URLEncoded -> [String] -- | Return the first value for the given key, or throw an error if -- the key is not present in the URLEncoded data. lookup1 :: (URLShow a, MonadError e m) => a -> URLEncoded -> m String lookupDefault :: (URLShow a) => String -> a -> URLEncoded -> String pairs :: URLEncoded -> [(String, String)] -- | Look up a key in a URLEncoded value and return the first matching -- value, or Nothing if there is no value that matches (%!) :: (URLShow a) => URLEncoded -> a -> Maybe String -- | Add this URL-encoded data to the query part of a URI, after any -- existing query arguments. addToURI :: URLEncoded -> URI -> URI -- | Convert this URLEncoded object into an x-www-urlencoded String (The -- resulting string is 7-bit clean ASCII, containing only unreserved URI -- characters and %-encoded values) export :: URLEncoded -> String instance Monoid URLEncoded instance Eq URLEncoded instance Show URLEncoded instance URLShow Bool instance URLShow Integer instance URLShow Int instance URLShow [Char] instance URLShow URLEncoded instance URLShow URI instance URLShow Char instance URLEncode URLEncoded instance (URLEncode a) => URLEncode (Maybe a) instance (URLShow a, URLShow b) => URLEncode (a, b) instance AddURLEncoded URLEncoded instance AddURLEncoded URI instance AddURLEncoded [Char]