[Haskell-beginners] Module name from a function name?

Jong-won Choi oz.jongwon.choi at gmail.com
Thu Jul 25 05:27:59 CEST 2013


Hi,

I am self-teaching Haskell and also try to fix a slightly broken Emacs
mode for Haskell.

I'd like to browse Haskell documentation from Emacs - C-c C-d on a
function name, say.

Current Emacs Lisp Haskell mode implementation uses return value of
':info', for example, GHC.List for length (the function name I want to
browse).
Unfortunately, this does not work because Glasgow Haskell's HTML doc
uses module name Data.List(i.e. Data-List.html) instead of GHC.List.

I'd like to get 'Data.List' from 'length'. How can I do this?

For example, if it is Common Lisp, this can be achieved by:
(symbol-package 'length)

One more thing. I think :info command is only for GHC. Is there any
portable ways which will work on other implementations as well?

Thanks!

- Jong-won Choi




More information about the Beginners mailing list