<div dir="ltr">GHC has a "--show-iface" option which pretty prints the ".hi" file. Not sure if it works for your use-case but it may be easier to parse the text displayed by this option.<div><br></div><div>-harendra</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 December 2017 at 21:29, Saurabh Nanda <span dir="ltr"><<a href="mailto:saurabhnanda@gmail.com" target="_blank">saurabhnanda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>(GHC newbie alert -- is this the right mailing list for these kind of questions?)<br><br></div>I"m writing some code to figure out all the instances of particular type-classes and after exploring a lot of options (hlint, haskell-src-exts, annotations, doctests, etc), I realized that the compiler had already figured it out and written it to disk for me! <br><br></div>More digging led me to <a href="https://www.stackage.org/haddock/lts-9.0/ghc-8.0.2/LoadIface.html#v:loadSrcInterface" target="_blank">https://www.stackage.org/<wbr>haddock/lts-9.0/ghc-8.0.2/<wbr>LoadIface.html#v:<wbr>loadSrcInterface</a> after which I got stuck. How does one call this function? Specifically:<br><br></div>* What is SDoc and how to construct a reasonable value for this argument?<br></div>* IsBootInterface would mostly be False, right?<br></div>* What does `Maybe FastString` represent and how does one construct it?<br></div>* Finally how does one evaluate the resulting monadic action to get access to the underlying `ModIface`?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">-- Saurabh.<br><br></font></span></div>
<br>______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>