api to access .hi files

Sam Halliday sam.halliday at gmail.com
Sat Jul 27 21:14:07 UTC 2019


Hello all,

I'd like to learn how to use the ghc api programmatically, but I am finding the haddocks (on hackage) to be a bit overwhelming. Could somebody please help me out by pointing me in the direction of the parts of the haddocks that are relevant to access information from .hi files that are available in the current build environment?

In particular, I'm mostly interested in gathering information about symbols and their type signatures. As a first exercise: given a module+import section for a haskell source file, I want to find out which symbols (and their types) are available. Like :browse in ghci, but programmatically.

PS: I'm aware that the .hie format is up and coming. I'm very excited by this! But I'm going to be using ghc-8.4.x and ghc-8.6.x for the foreseeable future, so I am mostly interested in what they have to offer.

-- 
Best regards,
Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190727/1a5c5317/attachment.sig>


More information about the ghc-devs mailing list