alfred 0.3.1 → 0.4
raw patch · 2 files changed
+9/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Alfred: Search :: (Text -> Text) -> (Text -> Text) -> (Text -> Text) -> Search
+ Alfred: Search :: (Text -> Text) -> (Text -> Text) -> (a -> Text) -> Search a
- Alfred: Search' :: Search -> (a -> Text) -> (a -> Text) -> Search' a
+ Alfred: Search' :: Search a -> (a -> Text) -> (a -> Text) -> Search' a
- Alfred: data Search
+ Alfred: data Search a
- Alfred: found :: Search -> Text -> Text
+ Alfred: found :: Search a -> a -> Text
- Alfred: notFound :: Search -> Text -> Text
+ Alfred: notFound :: Search a -> Text -> Text
- Alfred: searchRenderer :: Search -> Renderer [Text]
+ Alfred: searchRenderer :: Search Text -> Renderer [Text]
- Alfred: searchURL :: Search -> Text -> Text
+ Alfred: searchURL :: Search a -> Text -> Text
- Alfred: simpleSearch :: Search' a -> Search
+ Alfred: simpleSearch :: Search' a -> Search a
Files
- alfred.cabal +1/−1
- src/Alfred.hs +8/−5
alfred.cabal view
@@ -1,5 +1,5 @@ Name: alfred-Version: 0.3.1+Version: 0.4 Synopsis: utility library for Alfred version 2 Description: A utility library for writing workflows for Alfred version 2
src/Alfred.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-}-+{-# LANGUAGE CPP #-} -------------------------------------------------------------------------------- -- | -- Module : Alfred@@ -55,7 +55,10 @@ , Search (..) , Search' (..)) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative+#endif+ import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.List@@ -177,12 +180,12 @@ -- | This data type represents standard search scripts used by -- 'searchRenderer'.-data Search = Search {searchURL, found, notFound :: Text -> Text}+data Search a = Search {searchURL, notFound :: Text -> Text, found :: a -> Text} -- | This data type represents advanced standard search scripts used -- by 'searchRenderer''.-data Search' a = Search' {simpleSearch :: Search,+data Search' a = Search' {simpleSearch :: Search a, resultURL :: a -> Text, resultTitle :: a -> Text} @@ -199,7 +202,7 @@ -- @ -- -searchRenderer :: Search -> Renderer [Text]+searchRenderer :: Search Text -> Renderer [Text] searchRenderer s = searchRenderer' Search' { simpleSearch = s, resultURL = searchURL s . escapeText , resultTitle = id} @@ -239,7 +242,7 @@ valid=Nothing,autocomplete=Nothing,title= s, subtitle=T.concat ["Error: ", err],icon=Just (IconFile "icon.png")}] where mkItem t = Item {uid=Nothing,arg=arg,isFile=False,valid=Nothing,- autocomplete=Just t', title=t', subtitle=found t',icon=Just (IconFile "icon.png")}+ autocomplete=Just t', title=t', subtitle=found t,icon=Just (IconFile "icon.png")} where arg = T.concat ["\"",resultURL t,"\" \"", searchURL (escapeText s), "\""] t' = resultTitle t searchURL2 s = T.concat ["\"",url,"\" \"", url, "\""]