Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Patrick Bahr <paba@di.ku.dk> |
Safe Haskell | None |
This module provides utility functions to query web APIs. These queries can then be used to feed Alfred with suggestions.
- jsonQuery :: FromJSON a => Text -> Query a
- jsonQuery' :: FromJSON a => (ByteString -> ByteString) -> Text -> Query a
- xmlQuery :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)
- xmlQueryLazy :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)
- escapeString :: String -> String
- escapeText :: Text -> Text
- type Query a = Query' Text a
- transformQuery :: (a -> b) -> Query' q a -> Query' q b
- type Query' q a = q -> IO (Either Text a)
Documentation
jsonQuery' :: FromJSON a => (ByteString -> ByteString) -> Text -> Query aSource
xmlQuery :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)Source
xmlQueryLazy :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)Source
Lazy variant of xmlQueryLazy
. This function may be useful if
results tend to be lengthy and only a small prefix of the result is
used.
escapeString :: String -> StringSource
Escapes the string for use in a URL.
escapeText :: Text -> TextSource
Escapes the text for use in a URL.
transformQuery :: (a -> b) -> Query' q a -> Query' q bSource
Functorial map for Query'
.