
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

The problem is that length is defined in GHC.List and simple re-exported by
Data.List (and by Prelude).
You could try tying into a command-line installation of Hoogle. A quick
search for "length" on the Hoogle website shows that it finds it in both
Prelude and Data.List.
-Karl
On Wed, Jul 24, 2013 at 8:27 PM, Jong-won Choi
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
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Hi Karl, Then let me change my question; how can I get all the module names which (re-)export a given function name? I can make my Emacs Lisp code work if I can get a list of all such module names. Thanks! - Jong-won 2013-07-25 ?? 2:49, Karl Voelker ? ?:
The problem is that length is defined in GHC.List and simple re-exported by Data.List (and by Prelude).
You could try tying into a command-line installation of Hoogle. A quick search for "length" on the Hoogle website shows that it finds it in both Prelude and Data.List.
-Karl
On Wed, Jul 24, 2013 at 8:27 PM, Jong-won Choi
mailto:oz.jongwon.choi@gmail.com> wrote: 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
_______________________________________________ Beginners mailing list Beginners@haskell.org mailto:Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (2)
-
Jong-won Choi
-
Karl Voelker