Avoiding `OtherCon []` unfoldings, restoring definitions from unfoldings

Simon Peyton Jones simon.peytonjones at gmail.com
Fri Apr 1 16:51:19 UTC 2022


I don't think any top-level Ids should have OtherCon [] unfoldings?  If
they do, can you give a repro case?  OtherCon [] unfoldings usually mean "I
know this variable is evaluated, but I don't know what its value is.  E.g
   data T = MkT !a !a
  f (MkT x y) = ...

here x and y have OtherCon [] unfoldings. They are definitely not bottom!

You may want stronger invariants on the output of CorePrep than we have
hitherto sought.  Can you explain what they are?  And why you want the
output of CorePrep not CoreTidy?

Thanks

Simon

On Fri, 1 Apr 2022 at 09:13, ÉRDI Gergő <gergo at erdi.hu> wrote:

> Hi,
>
> I'm CC-ing the Clash mailing list because I believe they should have
> encountered the same problem (and perhaps have found a solution to it
> already!).
>
> I'm trying to use `.hi` files compiled with `ExposeAllUnfoldings` set to
> reconstruct full Core bindings for further processing. By and large, this
> works, but I get tripped up on identifiers whose unfolding is only given
> as `OtherCon []`. It is unclear to me what is causing this -- some of them
> are recursive bindings while others are not.
>
> The problem, of course, is that if all I know about an identifier is that
> it is `OtherCon []`, that doesn't allow me to restore its definition. So
> is there a way to tell GHC to put "full" unfoldings everywhere in
> `ExposeAllUnfoldings` mode?
>
> Thanks,
>         Gergo
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220401/a8fd0314/attachment.html>


More information about the ghc-devs mailing list