| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.HTTP.Types.QueryLike
Description
Some type classes to make more general functions when handling query strings.
Synopsis
- class QueryLike a where
- class QueryKeyLike a where
- toQueryKey :: a -> ByteString
- class QueryValueLike a where
- toQueryValue :: a -> Maybe ByteString
Documentation
Types which can, and commonly are, converted to Query are in this class.
You can use lists of simple key value pairs, with ByteString (strict, or lazy:
ByteString), Text, or String as the key/value types. You can also have the value
type lifted into a Maybe to support keys without values; and finally it is possible to put
each pair into a Maybe for key-value pairs that aren't always present.
Since: 0.7.0
Instances
| (QueryKeyLike k, QueryValueLike v) => QueryLike [Maybe (k, v)] # | |
Defined in Network.HTTP.Types.QueryLike | |
| (QueryKeyLike k, QueryValueLike v) => QueryLike [(k, v)] # | |
Defined in Network.HTTP.Types.QueryLike | |
class QueryKeyLike a where #
Types which, in a Query-like key-value list, are used in the Key position.
Since: 0.7.0
Methods
toQueryKey :: a -> ByteString #
Instances
| QueryKeyLike ByteString # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryKey :: ByteString -> ByteString # | |
| QueryKeyLike ByteString # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryKey :: ByteString -> ByteString # | |
| QueryKeyLike Text # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryKey :: Text -> ByteString # | |
| QueryKeyLike [Char] # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryKey :: [Char] -> ByteString # | |
class QueryValueLike a where #
Types which, in a Query-like key-value list, are used in the Value position.
Since: 0.7.0
Methods
toQueryValue :: a -> Maybe ByteString #
Instances
| QueryValueLike ByteString # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryValue :: ByteString -> Maybe ByteString # | |
| QueryValueLike ByteString # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryValue :: ByteString -> Maybe ByteString # | |
| QueryValueLike Text # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryValue :: Text -> Maybe ByteString # | |
| QueryValueLike a => QueryValueLike (Maybe a) # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryValue :: Maybe a -> Maybe ByteString # | |
| QueryValueLike [Char] # | |
Defined in Network.HTTP.Types.QueryLike Methods toQueryValue :: [Char] -> Maybe ByteString # | |