Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
class QueryLike a where Source #
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)] Source # | |
(QueryKeyLike k, QueryValueLike v) => QueryLike [(k, v)] Source # | |
Defined in Network.HTTP.Types.QueryLike |
class QueryKeyLike a where Source #
Types which, in a Query-like key-value list, are used in the Key position.
Since: 0.7.0
toQueryKey :: a -> ByteString Source #
Instances
QueryKeyLike ByteString Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryKey :: ByteString -> ByteString Source # | |
QueryKeyLike ByteString Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryKey :: ByteString -> ByteString0 Source # | |
QueryKeyLike Text Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryKey :: Text -> ByteString Source # | |
QueryKeyLike [Char] Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryKey :: [Char] -> ByteString Source # |
class QueryValueLike a where Source #
Types which, in a Query-like key-value list, are used in the Value position.
Since: 0.7.0
toQueryValue :: a -> Maybe ByteString Source #
Instances
QueryValueLike ByteString Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryValue :: ByteString -> Maybe ByteString Source # | |
QueryValueLike ByteString Source # | |
Defined in Network.HTTP.Types.QueryLike | |
QueryValueLike Text Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryValue :: Text -> Maybe ByteString Source # | |
QueryValueLike a => QueryValueLike (Maybe a) Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryValue :: Maybe a -> Maybe ByteString Source # | |
QueryValueLike [Char] Source # | |
Defined in Network.HTTP.Types.QueryLike toQueryValue :: [Char] -> Maybe ByteString Source # |