aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-03-16 22:57:28 +0100
committergwern0 <gwern0@gmail.com>2008-03-16 22:57:28 +0100
commit1295c4981c7486f0a538ece9c51a4308385547a4 (patch)
treead5a4d110821e4030146ad8ba2f37d086eef5c90
parent968df42998019220861a025cb4408440c88a343d (diff)
downloadXMonadContrib-1295c4981c7486f0a538ece9c51a4308385547a4.tar.gz
XMonadContrib-1295c4981c7486f0a538ece9c51a4308385547a4.tar.xz
XMonadContrib-1295c4981c7486f0a538ece9c51a4308385547a4.zip
Search.hs: try to add a more descriptive type
darcs-hash:20080316215728-f7719-c3c8ea6ab46a743ff02f909bd867d5878053988b.gz
-rw-r--r--XMonad/Actions/Search.hs5
1 files changed, 3 insertions, 2 deletions
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.