Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
Synopsis
- data URLEncoded
- filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncoded
- class URLShow a where
- class URLEncode a where
- urlEncode :: a -> URLEncoded
- empty :: URLEncoded
- importString :: MonadFail m => String -> m URLEncoded
- importList :: [(String, String)] -> URLEncoded
- importURI :: MonadFail m => URI -> m URLEncoded
- (%=) :: (URLShow a, URLShow b) => a -> b -> URLEncoded
- (%=?) :: (URLShow a, URLShow b) => a -> Maybe b -> URLEncoded
- (%&) :: (URLEncode q1, URLEncode q2) => q1 -> q2 -> URLEncoded
- class AddURLEncoded a where
- null :: URLEncoded -> Bool
- keys :: URLEncoded -> [String]
- lookup :: URLShow a => a -> URLEncoded -> Maybe String
- lookupAll :: URLShow a => a -> URLEncoded -> [String]
- lookup1 :: (URLShow a, MonadFail m) => a -> URLEncoded -> m String
- lookupDefault :: URLShow a => String -> a -> URLEncoded -> String
- pairs :: URLEncoded -> [(String, String)]
- (%!) :: URLShow a => URLEncoded -> a -> Maybe String
- addToURI :: URLEncoded -> URI -> URI
- export :: URLEncoded -> String
Representation of a URL-encoded string
data URLEncoded Source #
A container for URLEncoded data
Instances
Eq URLEncoded Source # | |
Defined in Data.URLEncoded (==) :: URLEncoded -> URLEncoded -> Bool # (/=) :: URLEncoded -> URLEncoded -> Bool # | |
Show URLEncoded Source # | |
Defined in Data.URLEncoded showsPrec :: Int -> URLEncoded -> ShowS # show :: URLEncoded -> String # showList :: [URLEncoded] -> ShowS # | |
Semigroup URLEncoded Source # | |
Defined in Data.URLEncoded (<>) :: URLEncoded -> URLEncoded -> URLEncoded # sconcat :: NonEmpty URLEncoded -> URLEncoded # stimes :: Integral b => b -> URLEncoded -> URLEncoded # | |
Monoid URLEncoded Source # | |
Defined in Data.URLEncoded mempty :: URLEncoded # mappend :: URLEncoded -> URLEncoded -> URLEncoded # mconcat :: [URLEncoded] -> URLEncoded # | |
URLShow URLEncoded Source # | |
Defined in Data.URLEncoded urlShow :: URLEncoded -> String Source # | |
URLEncode URLEncoded Source # | |
Defined in Data.URLEncoded urlEncode :: URLEncoded -> URLEncoded Source # | |
AddURLEncoded URLEncoded Source # | |
Defined in Data.URLEncoded (%?) :: URLEncode args => URLEncoded -> args -> URLEncoded Source # |
filter :: ((String, String) -> Bool) -> URLEncoded -> URLEncoded Source #
Create a URLEncoded object that represents all pairs from the input that match the supplied predicate
class URLShow a where Source #
Serialize a value into a String for encoding as part of an x-www-urlencoded value
class URLEncode a where Source #
Encode a value as x-www-urlencoded
urlEncode :: a -> URLEncoded Source #
Instances
URLEncode URLEncoded Source # | |
Defined in Data.URLEncoded urlEncode :: URLEncoded -> URLEncoded Source # | |
URLEncode a => URLEncode (Maybe a) Source # | |
Defined in Data.URLEncoded urlEncode :: Maybe a -> URLEncoded Source # | |
(URLShow a, URLShow b) => URLEncode (a, b) Source # | |
Defined in Data.URLEncoded urlEncode :: (a, b) -> URLEncoded Source # |
Generate
empty :: URLEncoded Source #
URLEncoded data with no pairs
importString :: MonadFail m => String -> m URLEncoded Source #
Parse this string as x-www-urlencoded @since 0.5.0.0
importList :: [(String, String)] -> URLEncoded Source #
Import this list of pairs as URLEncoded data
(%=) :: (URLShow a, URLShow b) => a -> b -> URLEncoded infixl 8 Source #
Create singleton URLEncoded data containing the supplied key and value
:: (URLShow a, URLShow b) | |
=> a | key |
-> Maybe b | value |
-> URLEncoded |
If the second value is Nothing, return empty URLEncoded data. Otherwise return singleton URLEncoded data that contains the given key and value.
class AddURLEncoded a where Source #
Instances
AddURLEncoded URI Source # | |
AddURLEncoded URLEncoded Source # | |
Defined in Data.URLEncoded (%?) :: URLEncode args => URLEncoded -> args -> URLEncoded Source # | |
AddURLEncoded [Char] Source # | |
Query
null :: URLEncoded -> Bool Source #
Is this URLEncoded data empty?
keys :: URLEncoded -> [String] Source #
All of the keys from the URLEncoded value, in order, preserving duplicates
lookupAll :: URLShow a => a -> URLEncoded -> [String] Source #
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.
lookup1 :: (URLShow a, MonadFail m) => a -> URLEncoded -> m String Source #
Return the first value for the given key, or throw an error if the key is not present in the URLEncoded data. @since 0.5.0.0
lookupDefault :: URLShow a => String -> a -> URLEncoded -> String Source #
(%!) :: URLShow a => URLEncoded -> a -> Maybe String infixr 1 Source #
Look up a key in a URLEncoded value and return the first matching value, or Nothing if there is no value that matches
Export
addToURI :: URLEncoded -> URI -> URI Source #
Add this URL-encoded data to the query part of a URI, after any existing query arguments.
export :: URLEncoded -> String Source #
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)