Potential bug in `zapFragileUnfolding`
Currently it's defined like this:
zapFragileUnfolding :: Unfolding -> Unfolding
-- ^ Zaps any core unfolding, but /preserves/ evaluated-ness,
-- i.e. an unfolding of OtherCon
zapFragileUnfolding unf
| hasCoreUnfolding unf = noUnfolding
| otherwise = unf
But that's a bit odd. Clearly if the unfolding is something like Just 1 :: Maybe Int
that's evaluated and a core unfolding. But we will lose the evaluatedness of this unfolding in the current implementation!
Rather it should probably be:
zapFragileUnfolding :: Unfolding -> Unfolding
-- ^ Zaps any core unfolding, but /preserves/ evaluated-ness,
-- i.e. an unfolding of OtherCon
zapFragileUnfolding unf
| isEvaldUnfolding unf = evaldUnfolding
| otherwise = noUnfolding