<div dir="ltr"><div>Hi list,</div><div><br></div><div>I was looking at the `Eq (DeBruijn CoreExpr)` instance and I noticed that the types of recursive let-bindings aren't checked for alpha-equivalence:</div><div><br></div><div><a href="https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Core/Map/Expr.hs#L166-174">https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Core/Map/Expr.hs#L166-174</a></div><div><br></div><div>    go (Let (Rec ps1) e1) (Let (Rec ps2) e2)<br>      = equalLength ps1 ps2<br>      && D env1' rs1 == D env2' rs2<br>      && D env1' e1  == D env2' e2<br>      where<br>        (bs1,rs1) = unzip ps1<br>        (bs2,rs2) = unzip ps2<br>        env1' = extendCMEs env1 bs1<br>        env2' = extendCMEs env2 bs2</div><div><br></div><div>But doesn't that mean that:<br><br></div><div>let (x :: Int) = x in x <br><br></div><div>and <br><br></div><div>let (y :: Bool) = y in y<br><br></div><div>are considered alpha-equivalent?</div><div>If that is the case, then I think that's wrong. Agree?</div><div>I understand that you don't have to check types for non-recursive let-bindings: when the RHSs match, the types must be the same.<br></div><div><br></div><div>-- Christiaan<br></div><div><br></div></div>