Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
5597 commits behind the upstream repository.
  • Ömer Sinan Ağacan's avatar
    bb929009
    Fix arity type of coerced types in CoreArity · bb929009
    Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
    Previously if we had
    
        f |> co
    
    where `f` had arity type `ABot N` and `co` had arity M and M < N,
    `arityType` would return `ABot M` which is wrong, because `f` is only
    known to diverge when applied to `N` args, as described in Note
    [ArityType]:
    
        If at = ABot n, then (f x1..xn) definitely diverges. Partial
        applications to fewer than n args may *or may not* diverge.
    
    This caused incorrect eta expansion in the simplifier, causing #16066.
    
    We now return `ATop M` for the same expression so the simplifier can't
    assume partial applications of `f |> co` is divergent.
    
    A regression test T16066 is also added.
    bb929009
    History
    Fix arity type of coerced types in CoreArity
    Ömer Sinan Ağacan authored and Marge Bot's avatar Marge Bot committed
    Previously if we had
    
        f |> co
    
    where `f` had arity type `ABot N` and `co` had arity M and M < N,
    `arityType` would return `ABot M` which is wrong, because `f` is only
    known to diverge when applied to `N` args, as described in Note
    [ArityType]:
    
        If at = ABot n, then (f x1..xn) definitely diverges. Partial
        applications to fewer than n args may *or may not* diverge.
    
    This caused incorrect eta expansion in the simplifier, causing #16066.
    
    We now return `ATop M` for the same expression so the simplifier can't
    assume partial applications of `f |> co` is divergent.
    
    A regression test T16066 is also added.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
T16066.hs 778 B