-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | utility library for Alfred version 2
--
-- A utility library for writing workflows for Alfred version 2
-- (http://www.alfredapp.com).
@package alfred
@version 0.2
module Alfred.Query
jsonQuery :: FromJSON a => Text -> Query a
xmlQuery :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)
-- | 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.
xmlQueryLazy :: (GenericXMLString a, GenericXMLString b) => Text -> Query (Node a b)
-- | Escapes the string for use in a URL.
escapeString :: String -> String
-- | Escapes the text for use in a URL.
escapeText :: Text -> Text
-- | Type representing queries for use in runScript.
type Query a = Query' Text a
-- | Functorial map for Query'.
transformQuery :: (a -> b) -> Query' q a -> Query' q b
-- | Alternative type representing queries for use in runScript'.
type Query' q a = q -> IO (Either String a)
module Alfred
-- | This type represents items that should be rendered by Alfred as the
-- result of a script filter.
data Item
Item :: Maybe Text -> Text -> Bool -> Maybe Bool -> Maybe Text -> Text -> Text -> Maybe Icon -> Item
uid :: Item -> Maybe Text
arg :: Item -> Text
isFile :: Item -> Bool
valid :: Item -> Maybe Bool
autocomplete :: Item -> Maybe Text
title :: Item -> Text
subtitle :: Item -> Text
icon :: Item -> Maybe Icon
-- | Default item.
item :: Item
-- | Represents icons of an item.
data Icon
FileIcon :: Text -> Icon
FileType :: Text -> Icon
IconFile :: Text -> Icon
-- | This type represents rendering functions as used by runScript.
type Renderer a = Renderer' Text a
-- | This type represents rendering functions as used by runScript'.
type Renderer' q a = q -> Either String a -> Items
-- | This function runs a script consisting of a query function and a
-- rendering function. The query function takes string parameters and
-- produces an output that is then passed to the rendering function to
-- produce items that are then passed to Alfred.
runScript :: Query a -> Renderer a -> IO ()
-- | This function runs a script consisting of a query function and a
-- rendering function. The query function takes string parameters and
-- produces an output that is then passed to the rendering function to
-- produce items that are then passed to Alfred.
runScript' :: ([Text] -> q) -> Query' q a -> Renderer' q a -> IO ()
searchRenderer :: Search -> Renderer [Text]
-- | This data type represents standard search scripts used by
-- searchRenderer.
data Search
Search :: (Text -> Text) -> (Text -> Text) -> (Text -> Text) -> (Text -> Text) -> Search
searchURL :: Search -> Text -> Text
found :: Search -> Text -> Text
notFound :: Search -> Text -> Text
suggestError :: Search -> Text -> Text