Note [Literal alternatives]
Literal alternatives (LitAlt lit) are always for *un-lifted* literals. We have one literal, a literal Integer, that is lifted, and we don't allow in a LitAlt, because LitAlt cases don't do any evaluation. Also (see #5603) if you say case 3 of IS x -> ... IP _ -> ... IN _ -> ... (where IS, IP, IN are the constructors for Integer) we don't want the simplifier calling findAlt with argument (LitAlt 3). No no. Integer literals are an opaque encoding of an algebraic data type, not of an unlifted literal, like all the others. Also, we do not permit case analysis with literal patterns on floating-point types. See #9238 and Note [Rules for floating-point comparisons] in GHC.Core.Opt.ConstantFold for the rationale for this restriction. GHC.Core INVARIANTS ---------------------------
References 1
- Rules for floating-point comparisons GHC.Core.Opt.ConstantFold
Referenced by 1
- GHC.Core call site