<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to compile some module with GHC API. I'm going to feed GHC with Core generated by me.</div><div><br></div><div>So far is noticed, that function compileCoreToObj ends with an runtime error on each call. In spide of this function produces some *.o and *.hi files. However, produced interface file does not contain any item in exports field, what makes compiled module unusable.</div><div><br></div><div>Because of this problem, I tried to achieve my goal by using steps described here: <a href="https://wiki.haskell.org/GHC/As_a_library" target="_blank">https://wiki.haskell.org/GHC/As_a_library</a> (the second example)</div><div>I was able to print out Core produced form file. If I'm not wrong, modifying structures passing on between sequent calls does not effect on produced *.hi and *.o files. Both files are generated by `load LoadAllTargets' call, and further calls (parseModule, loadModule, ...) does not effect on generated files.</div><div><br></div><div>Could You give me any advices in that topic? Am I right about compileCoreToObj and functions mentioned above?</div><div><br></div><div><div dir="ltr"><div>Best Regards,</div><div>Marek</div></div></div></div></div></div>