[xmonad] Misleading documentation for XMonad.Actions.Search
Wirt Wolff
wirtwolff at gmail.com
Tue Mar 22 00:52:12 CET 2011
Excerpts from Gwern Branwen's message of Mon Mar 21 16:00:51 -0600 2011:
> On Sun, Mar 20, 2011 at 4:54 PM, Mats Rauhala <mats.rauhala at gmail.com> wrote:
> > The documentation for (!>) in XMonad.Actions.Search is misleading. The
> > documentation says "> multiEngine = intelligent (wikipedia !> mathworld
> > !> (prefixAware google))", but this syntax doesn't provide the expected
> > behaviour.
> > ..
>
> I never use this particular functionality (nor did I write it; Michal
> Trybus apparently did), but is this *desired* behavior? I mean, adding
> a infixity declaration would seem to bring the code back into
> correspondence with the documentation rather than the other way
> around. If you add
>
> hunk ./XMonad/Actions/Search.hs 327
> +infixr 7 !>
> +
>
> Then GHCi seems to give the documentation's results:
>
> *XMonad.Actions.Search Control.Monad Data.Char Data.List> use
> (wikipedia !> hoogle !> prefixAware google) "hoogle:foo"
> Loading package X11-1.5.0.0 ... linking ... done.
> Loading package utf8-string-0.3.6 ... linking ... done.
> Loading package xmonad-0.10 ... linking ... done.
> "http://www.haskell.org/hoogle/?q=foo"
>
I've also not used this before, but may now that I'm aware of it. Yes,
adding the infix declaration seems a preferable solution.
Something else to note and fix is that as it stands in the current darcs
version, wikipedia and wiktionary don't work properly with any of these
intelligent searches. (Probably because their urls contain the ':'
character.)
Haven't looked much at the code, but if it's not an obvious fix...
Rather than making the parsing even more complicated, hopefully there
will be alternate urls that will work. If I get a chance I'll check that
out later this week. Or it could just be noted in the docs and then yank
them from the `multi' foldr1.
regards,
wmw
More information about the xmonad
mailing list