http-types-0.12.3: Generic HTTP types for Haskell (for both client and server code).
Safe HaskellSafe-Inferred
LanguageHaskell98

Network.HTTP.Types.QueryLike

Synopsis

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.

Methods

toQuery :: a -> Query Source #

Convert to Query.

Instances

Instances details
(QueryKeyLike k, QueryValueLike v) => QueryLike [Maybe (k, v)] Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQuery :: [Maybe (k, v)] -> Query Source #

(QueryKeyLike k, QueryValueLike v) => QueryLike [(k, v)] Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQuery :: [(k, v)] -> Query Source #

class QueryKeyLike a where Source #

Types which, in a Query-like key-value list, are used in the Key position.

Methods

toQueryKey :: a -> ByteString Source #

Instances

Instances details
QueryKeyLike ByteString Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryKey :: ByteString -> ByteString Source #

QueryKeyLike ByteString Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryKey :: ByteString -> ByteString0 Source #

QueryKeyLike Text Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryKey :: Text -> ByteString Source #

QueryKeyLike [Char] Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryKey :: [Char] -> ByteString Source #

class QueryValueLike a where Source #

Types which, in a Query-like key-value list, are used in the Value position.

Methods

toQueryValue :: a -> Maybe ByteString Source #

Instances

Instances details
QueryValueLike ByteString Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryValue :: ByteString -> Maybe ByteString Source #

QueryValueLike ByteString Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryValue :: ByteString -> Maybe ByteString0 Source #

QueryValueLike Text Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryValue :: Text -> Maybe ByteString Source #

QueryValueLike [Char] Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryValue :: [Char] -> Maybe ByteString Source #

QueryValueLike a => QueryValueLike (Maybe a) Source # 
Instance details

Defined in Network.HTTP.Types.QueryLike

Methods

toQueryValue :: Maybe a -> Maybe ByteString Source #