Note [Respecting multiplicity when comparing types]
Generally speaking, we respect multiplicities (i.e. the linear part of the type system) when comparing types. Doing so is of course crucial during typechecking. But for reasons described in Note [Linting linearity] in GHC.Core.Lint, it is hard to ensure that Core is always type-correct when it comes to linearity. So * `eqTypeIgnoringMultiplicity` provides a way to compare types that /ignores/ multiplicities * We use this multiplicity-blind comparison very occasionally, notably - in Core Lint: see Note [Linting linearity] in GHC.Core.Lint - in rule matching: see Note [Rewrite rules ignore multiplicities in FunTy] in GHC.Core.Unify
References 2
- Linting linearity GHC.Core.Lint
- Rewrite rules ignore multiplicities in FunTy GHC.Core.Unify
Referenced by 1
- GHC.Core.TyCo.Compare call site