Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 361 by dreamer...@gmail.com: A bug in Yi.Hoogle which trying to
pass an empty string to hoogle program as it's first arguments
http://code.google.com/p/yi-editor/issues/detail?id=361
What steps will reproduce the problem?
Start the ghci interpreter, input the following commands
ghci> import Yi.Hoogle
ghci> hoogleFunctions "hello"
*** Exception: user error (Error running hoogle command. Is hoogle on
path?)
I examined the source code of Yi.Hoogle, and found the definition of
hoogleFunctions
as following
hoogleFunctions a = caseSensitize . gv . nub . map ((!!1) . words) <$>
hoogleRaw a ""
Yes, an empty string passed to hoogleRaw, and finaly it was passed to
hoogle program
causing the bug.
In fact, the command next indeed fails
$ hoogle "" "hello"
This bug affects hoogleFunctions, hoogleFunModule, hoogle, hoogleSearch
Only a few extra letters needing to fix the bug. we can change the code at
line 28 from
hoogleRaw srch opts = do (out,_err,status) <- runProgCommand "hoogle"
[opts, srch]
to
hoogleRaw srch opts = do (out,_err,status) <- runProgCommand "hoogle"
(filter (not.null) [opts, srch])
--
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel