<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Thank you all for your help! It turns out that I was missing the
constraint solving and zonking step by desugaring the result of
tcInferSigma directly.<br>
</p>
<p>I have the implementation of the function <a
moz-do-not-send="true"
href="https://github.com/yiyunliu/ghc-elaboration-test/blob/8f362ad92dc6601b4cb7e4c76f0a42bc6b64480f/src/Main.hs#L55">here</a>.
Not sure if it's 100% correct but at least it works for all the
examples I can come up with so far.<br>
</p>
<p>- Yiyun<br>
</p>
<div class="moz-cite-prefix">On 1/22/20 7:09 AM, Andreas Klebinger
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:6c1ee9c9-a759-e246-aa9b-2e129b3ecfa8@gmx.at">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
I tried this for fun a
while ago and ran into the issue of needing to provide a type
environment containing Prelude and so on.<br>
I gave up on that when some of the calls failed because I must
have
missed to set up some implicit state properly.<br>
I didn't have an actual use case (only curiosity) so I didn't look
further into it. If you do find a way please let me know.<br>
<br>
I would also support adding any missing functions to
GHC-the-library to
make this possible if any turn out to be required.<br>
<br>
As an alternative you could also use the GHCi approach of using a
fake
Module. This would allow you to copy whatever GHCi is doing.<br>
But I expect that to be slower if you expect to process many such
strings, <br>
<br>
<span>Richard Eisenberg schrieb am 22.01.2020 um 10:36:</span><br>
<blockquote type="cite"
cite="mid:07D49BF1-AC80-4E91-B14C-7F8BEB82F47C@richarde.dev">You'll
need to run the expression through the whole pipeline.
<div class=""><br class="">
</div>
<div class="">1. Parsing</div>
<div class="">2. Renaming</div>
<div class="">3. Type-checking</div>
<div class=""> <span style="display: inline; font-size:
inherit;
padding: 0px;" class="__postbox-detected-content
__postbox-detected-date"
__postbox-detected-content="__postbox-detected-date"><span
style="display: inline; font-size: inherit; padding: 0px;"
class="__postbox-detected-content __postbox-detected-date"
__postbox-detected-content="__postbox-detected-date">3a.</span></span>
Constraint generation</div>
<div class=""> 3b. Constraint solving</div>
<div class=""> 3c. Zonking</div>
<div class="">4. Desugaring</div>
</blockquote>
<br>
</blockquote>
</body>
</html>