From 1295c4981c7486f0a538ece9c51a4308385547a4 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Sun, 16 Mar 2008 22:57:28 +0100 Subject: Search.hs: try to add a more descriptive type darcs-hash:20080316215728-f7719-c3c8ea6ab46a743ff02f909bd867d5878053988b.gz --- XMonad/Actions/Search.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'XMonad/Actions/Search.hs') diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 4ea568a..ec142c4 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -156,11 +156,12 @@ escape = escapeURIString (\c -> isAlpha c || isDigit c || isMark c) | otherwise = chr (ord 'A' + fromIntegral (d - 10)) type Browser = FilePath +type Query = String type SearchEngine = String -> String {- | Given a browser, a search engine, and a search term, perform the requested search in the browser. -} -search :: MonadIO m => Browser -> SearchEngine -> String -> m () +search :: MonadIO m => Browser -> SearchEngine -> Query -> m () search browser site query = safeSpawn browser $ site query {- | Given a base URL, create the SearchEngine that escapes the query and @@ -174,7 +175,7 @@ search browser site query = safeSpawn browser $ site query from site to site, often considerably. Generally, examining the resultant URL of a search will allow you to reverse-engineer it if you can't find the necessary URL already described in other projects such as Surfraw. -} -simpleEngine :: String -> SearchEngine +simpleEngine :: Query -> SearchEngine simpleEngine site query = site ++ escape query -- The engines. -- cgit v1.2.3