<div dir="ltr"><div>I am trying to extract information at the Core level about which functions are the most used within a package, which data types are the most used.<br></div><div><br></div><div>So how do I dump the contents of a module to a .hi file? Is this something I can do through the API?<br><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Alberto<br><div><br></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Jun 1, 2016 at 8:31 AM, Ömer Sinan Ağacan <span dir="ltr"><<a href="mailto:omeragacan@gmail.com" target="_blank">omeragacan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You have to do your manipulations module by module, as GHC is doing compilation<br>
that way. If you need some information from other modules when compiling a<br>
module, you should dump that information in .hi files (like definitions of<br>
inline functions).<br>
<br>
What exactly are you trying to do?<br>
<div class="HOEnZb"><div class="h5"><br>
2016-05-31 17:56 GMT-04:00 Alberto Sadde O. <<a href="mailto:albertosadde@gmail.com">albertosadde@gmail.com</a>>:<br>
><br>
>><br>
>> 2016-05-31 16:04 GMT-04:00 Alberto Sadde O. <<a href="mailto:albertosadde@gmail.com">albertosadde@gmail.com</a>>:<br>
>> > I am trying to get the Core of a whole package.<br>
>> > I have been using the GHC API to get the Core of each file in a package<br>
>> > but<br>
>> > I have a problems with non-exposed modules of the package.<br>
>><br>
>> Try `cabal install --ghc-options="-ddump-simpl -ddump-to-file"`. You<br>
>> should see Core outputs under `dist/`.<br>
>> (or `cabal configure --ghc-options=...` then `cabal build`)<br>
>><br>
>> If you have all the dependencies installed already you can just do<br>
>> `ghc --make Main.hs -fforce-recomp -ddump-simpl -ddump-to-file` where<br>
>> `Main.hs` imports all the modules in your project.<br>
><br>
><br>
> Thanks for the answer.<br>
> The thing is that I want to manipulate the Core of the package not just<br>
> simply dump it to a file.<br>
><br>
><br>
><br>
</div></div></blockquote></div><br></div>