XMonad.Actions.Search parsing and a new dep

While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically: intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s)) This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it. -- gwern

On Fri, Aug 07, 2009 at 08:22:08PM -0400, gwern0@gmail.com wrote:
While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically:
intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s))
This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool
Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it.
-- gwern
intelligent seems like a not-very-useful function, is a network dependency really worth it? Cheers, Spencer Janssen

spencerjanssen:
On Fri, Aug 07, 2009 at 08:22:08PM -0400, gwern0@gmail.com wrote:
While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically:
intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s))
This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool
Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it.
-- gwern
intelligent seems like a not-very-useful function, is a network dependency really worth it?
what about using the uri package (or ripping it out). -- Don

On Fri, Aug 7, 2009 at 8:49 PM, Don Stewart
spencerjanssen:
On Fri, Aug 07, 2009 at 08:22:08PM -0400, gwern0@gmail.com wrote:
While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically:
intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s))
This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool
Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it.
-- gwern
intelligent seems like a not-very-useful function, is a network dependency really worth it?
what about using the uri package (or ripping it out).
-- Don
Well, as far as ripping it out goes, it presumably is valuable to the fellow who took the effort to code it up and then get it into XMC (Michal Trybus). re: uri; what package is that? I don't see it on Hackage, and my ghc-pkg doesn't know it. If it's more 'lightweight' than using the URI modules in network, then I guess that'd be fine. re: network: as I discussed with Spencer in #xmonad, I'm not sure a network dependency is a very 'heavy' dependency. Apparently it isn't bundled with GHC by default, but do we have any users of XMonadContrib who do not also have network installed, or cabal-installable? (XMC currently depends on utf8-string and x11-xft, and those strike me as very heavyweight dependencies indeed - is the latter even pure Haskell?) -- gwern

On Sun, Aug 09, 2009 at 08:16:20AM -0400, Gwern Branwen wrote:
On Fri, Aug 7, 2009 at 8:49 PM, Don Stewart
wrote: spencerjanssen:
On Fri, Aug 07, 2009 at 08:22:08PM -0400, gwern0@gmail.com wrote:
While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically:
intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s))
This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool
Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it.
-- gwern
intelligent seems like a not-very-useful function, is a network dependency really worth it?
what about using the uri package (or ripping it out).
-- Don
Well, as far as ripping it out goes, it presumably is valuable to the fellow who took the effort to code it up and then get it into XMC (Michal Trybus).
I'm guessing Don meant to rip the isURI function out of its package and paste it into the Search module with a comment saying where it came from, not ripping out the 'intelligent' function. There is a 'url' package on Hackage, not sure if that's what Don was referring to. Yes, I know URL is not the same thing as URI, but really, are we ever going to refer to a search engine by something that is a URI but not a URL? -Brent

byorgey:
On Sun, Aug 09, 2009 at 08:16:20AM -0400, Gwern Branwen wrote:
On Fri, Aug 7, 2009 at 8:49 PM, Don Stewart
wrote: spencerjanssen:
On Fri, Aug 07, 2009 at 08:22:08PM -0400, gwern0@gmail.com wrote:
While adding & pushing a Wiktionary function, I noticed some of the functionality that's been added to XMonad.Actions.Search since I last looked; specifically:
intelligent ∷ SearchEngine → SearchEngine intelligent (SearchEngine name site) = searchEngineF name (λs → if (fst $ break (≡ ':') s) `elem` ["http", "https", "ftp"] then s else (site s))
This, I think, is much worse than just using Network.URI.isURI ∷ String → Bool
Problem is, Network.URI pulls in a network package dependency. This shouldn't be a problem as it's quite as usually installed as say process or directory, but I thought I'd ask before going ahead and adding it.
-- gwern
intelligent seems like a not-very-useful function, is a network dependency really worth it?
what about using the uri package (or ripping it out).
-- Don
Well, as far as ripping it out goes, it presumably is valuable to the fellow who took the effort to code it up and then get it into XMC (Michal Trybus).
I'm guessing Don meant to rip the isURI function out of its package and paste it into the Search module with a comment saying where it came from, not ripping out the 'intelligent' function.
There is a 'url' package on Hackage, not sure if that's what Don was referring to. Yes, I know URL is not the same thing as URI, but really, are we ever going to refer to a search engine by something that is a URI but not a URL?
Indeed, that is what I meant. I think adding 'network' as a dependency is a bad precedent. It goes one step too far towards bloat. My window manager should not confuse users by appearing to ask for network access. It's a delicate tension between features and bloat. By all means inline the require url/uri code you need though. -- Don
participants (5)
-
Brent Yorgey
-
Don Stewart
-
Gwern Branwen
-
gwern0@gmail.com
-
Spencer Janssen