Note [Dead code in CorePrep]
Imagine that we got an input program like this (see #4962): f :: Show b => Int -> (Int, b -> Maybe Int -> Int) f x = (g True (Just x) + g () (Just x), g) where g :: Show a => a -> Maybe Int -> Int g _ Nothing = x g y (Just z) = if z > 100 then g y (Just (z + length (show y))) else g y unknown After specialisation and SpecConstr, we would get something like this: f :: Show b => Int -> (Int, b -> Maybe Int -> Int) f x = (g$Bool_True_Just x + g$Unit_Unit_Just x, g) where {-# RULES g $dBool = g$Bool g $dUnit = g$Unit #
References 0
This Note does not link to any other.
Referenced by 3
- GHC.Core.Opt.OccurAnal call site
- GHC.CoreToStg.Prep call site
- Drop unfoldings and rules GHC.CoreToStg.Prep