Skip to content
  • Sebastian Graf's avatar
    Arity: Refactor fixed-point iteration in GHC.Core.Opt.Arity · 7eb46a09
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    Arity analysis used to propagate optimistic arity types during
    fixed-point interation through the `ArityEnv`'s `ae_cheap_fun` field,
    which is like `GHC.Core.Utils.exprIsCheap`, but also considers the
    current iteration's optimistic arity, for the binder in question only.
    
    In #18793, we have seen that this is a problematic design, because it
    doesn't allow us to look through PAP bindings of that binder.
    
    Hence this patch refactors to a more traditional form with an explicit
    signature environment, in which we record the optimistic `ArityType` of
    the binder in question (and at the moment is the *only* binder that is
    recorded in the arity environment).
    7eb46a09