GHC API user: How to stop simplifier from turning recursive let-bindings into mutually recursive functions

Ben Gamari ben at smart-cactus.org
Mon May 8 14:12:27 UTC 2017


Christiaan Baaij <christiaan.baaij at gmail.com> writes:

> Hello GHC Devs,
>
Hi!

> So my question are:
> - Which part of the simplifier is turning these local recursive let-binders
> into global recursive functions?

The simplifier does a bit of let floating. See Simplify.simplLazyBind
and SimplEnv.doFloatFromRhs. I suspect this is what you are seeing.

> - Is there some way to disable this transformation?

You could try adding a flag which is checked by doFloatFromRhs. I'm not
sure what, if anything, might break if you do so.

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170508/0980f7b6/attachment.sig>


More information about the ghc-devs mailing list