Inlining of `any @[]` vs `elem @[]`

ÉRDI Gergő gergo at erdi.hu
Fri Mar 12 10:34:39 UTC 2021


On Fri, 12 Mar 2021, ÉRDI Gergő wrote:

> I wonder why that is? What changed between GHC 8.10.3 and 9.0.1? Was the 
> definition of `elem` changed in `base`?

Oh, I've found this commit:

```
commit f10d11fa49fa9a7a506c4fdbdf86521c2a8d3495
Author: Andreas Klebinger <klebinger.andreas at gmx.at>
Date:   Wed Jan 29 15:25:07 2020 +0100

     Fix "build/elem" RULE.

     An redundant constraint prevented the rule from matching.

     Fixing this allows a call to elem on a known list to be translated
     into a series of equality checks, and eventually a simple case
     expression.

     [...]
```


More information about the ghc-devs mailing list