
Python had the "pydoc" command, which would could be used to print a
module's docstings from the command line, and provided the "help" function
in the REPL. Clojure has "doc" in the REPL, at least if you told it where
the sources were.
I can't seem to find anything like that for Haskell - either at the command
line or in ghci. Does such exist? Is such possible?
Thanks,

There is a hoogle command: https://hackage.haskell.org/package/hoogle.
I don't use it, but I imagine you would have to set documention: True in
cabal.config, so you get documentation for any packages you have, and then
either use your browser, or put an alias in your .ghci to query it in your
repl, or just use the executable.
On Thu, Mar 26, 2015 at 9:36 AM, Mike Meyer
Python had the "pydoc" command, which would could be used to print a module's docstings from the command line, and provided the "help" function in the REPL. Clojure has "doc" in the REPL, at least if you told it where the sources were.
I can't seem to find anything like that for Haskell - either at the command line or in ghci. Does such exist? Is such possible?
Thanks,
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

On Thu, Mar 26, 2015 at 8:44 AM, David McBride
There is a hoogle command: https://hackage.haskell.org/package/hoogle.
I don't use it, but I imagine you would have to set documention: True in cabal.config, so you get documentation for any packages you have, and then either use your browser, or put an alias in your .ghci to query it in your repl, or just use the executable.
The appropriate entries for .ghci are: :def hoogle \x -> return $ ":!hoogle \"" ++ x ++ "\"" :def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\"" That's actually close enough. However, the python & clojure commands use the current search path, not a database build from the online docs. I suspect this means I want a cabal command.
participants (2)
-
David McBride
-
Mike Meyer