<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I second Rahul in that -ddump-ds is what you want. But the desugarer actually does a quick "simple-optimization" pass before -ddump-ds. If you really want the raw desugarer output, you'll need -ddump-ds *and* a DEBUG build of GHC. See the code in Desugar here: <a href="https://github.com/ghc/ghc/blob/master/compiler/deSugar/Desugar.hs#L159" class="">https://github.com/ghc/ghc/blob/master/compiler/deSugar/Desugar.hs#L159</a></div><div class=""><br class=""></div><div class="">Richard</div><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 7, 2017, at 9:05 AM, Rahul Muttineni <<a href="mailto:rahulmutt@gmail.com" class="">rahulmutt@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Chris,<div class=""><br class=""></div><div class="">I think you're looking for -ddump-ds which outputs the Core just after the desugarer is done. -ddump-simpl gives the Core after the simplifier is run.</div><div class=""><br class=""></div><div class="">Hope that helps,</div><div class="">Rahul</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 7, 2017 at 6:25 PM, Christopher Done <span dir="ltr" class=""><<a href="mailto:chrisdone@gmail.com" target="_blank" class="">chrisdone@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="">
<br class="">
Just checking, if I want to see the Haskell code desugared to core<br class="">
BEFORE any simplification passes, is this the way to do it?<br class="">
<br class="">
bash-3.2$ cat > X.hs<br class="">
module X where it = (\x -> x * 2) 123<br class="">
bash-3.2$ stack exec -- ghc -ddump-simpl X.hs -fforce-recomp<br class="">
-fmax-simplifier-iterations=0 -O0<br class="">
[1 of 1] Compiling X                ( X.hs, X.o )<br class="">
<br class="">
==================== Tidy Core ====================<br class="">
Result size of Tidy Core = {terms: 11, types: 3, coercions: 0}<br class="">
<br class="">
-- RHS size: {terms: 4, types: 1, coercions: 0}<br class="">
it :: Integer<br class="">
[GblId, Str=DmdType]<br class="">
it = * @ Integer GHC.Num.$fNumInteger 123 2<br class="">
<br class="">
I was a bit surprised that the lambda is collapsed already with<br class="">
optimizations turned off and the simplifier iterations set to 0. I<br class="">
changed this to (\x -> x * x) and it produced a let instead. Is this<br class="">
just one of the things the HS->Core desugarer decides to do?<br class="">
<br class="">
Ciao!<br class="">
______________________________<wbr class="">_________________<br class="">
ghc-devs mailing list<br class="">
<a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank" class="">http://mail.haskell.org/cgi-<wbr class="">bin/mailman/listinfo/ghc-devs</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Rahul Muttineni</div>
</div>
_______________________________________________<br class="">ghc-devs mailing list<br class=""><a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br class=""></div></blockquote></div><br class=""></body></html>