<div dir="ltr"><div><div>> I would be cautious about using the ghc-api hi file interfaces; hi files
 turn out to interact with a <br>> lot of low-level parts in complex ways 
(even to the extent that they're a large part of why ghc <br>> can't 
parallelize builds itself and attempts to change that have mostly 
failed).<br><br></div>Are you cautioning against using the GHC API (as opposed to the --show-iface command line interface)</div><div>or using HI files themselves?<br><br></div>-- Saurabh.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 3, 2017 at 2:04 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@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">I would be cautious about using the ghc-api hi file interfaces; hi files turn out to interact with a lot of low-level parts in complex ways (even to the extent that they're a large part of why ghc can't parallelize builds itself and attempts to change that have mostly failed).<div><br></div><div>But if you must do this, you *really* want to have <a href="https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler" target="_blank">https://ghc.haskell.org/<wbr>trac/ghc/wiki/Commentary/<wbr>Compiler</a> ready to hand --- and go through it first so you have some idea of how it works; much of it is links to the lower level details (often straight into the source).</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Dec 2, 2017 at 10:59 AM, Saurabh Nanda <span dir="ltr"><<a href="mailto:saurabhnanda@gmail.com" target="_blank">saurabhnanda@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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/haddo<wbr>ck/lts-9.0/ghc-8.0.2/LoadIface<wbr>.html#v: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="m_-8472184998299592372HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-8472184998299592372HOEnZb"><font color="#888888">-- Saurabh.<br><br></font></span></div>
<br></div></div><span class="">______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">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-bi<wbr>n/mailman/listinfo/ghc-devs</a><br>
<br></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-8472184998299592372gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><a href="http://www.saurabhnanda.com" target="_blank">http://www.saurabhnanda.com</a></div>
</div>