On Fri, 1 Apr 2022, Sylvain Henry wrote:
The unfolding is present if you add `-fno-omit-interface-pragmas` and dump
with `-ddump-simpl`. CorePrep drops unfoldings, see Note [Drop unfoldings and
rules] in GHC.CoreToStg.Prep.
Thanks, I forgot to mention that I am already using
The unfolding is present if you add `-fno-omit-interface-pragmas` and
dump with `-ddump-simpl`. CorePrep drops unfoldings, see Note [Drop
unfoldings and rules] in GHC.CoreToStg.Prep.
The logic for unfolding exposition by Tidy is now in:
This doesn't quite match my experience. For example, the following
toplevel definition gets an `OtherCon []` unfolding:
nonEmptySubsequences :: [a] -> [[a]]
nonEmptySubsequences [] = []
nonEmptySubsequences (x:xs) = [x] : foldr f [] (nonEmptySubsequences xs)
where
f ys r = ys : (x:ys) : r
So if I understand correctly, OtherCon is only created here:
https://gitlab.haskell.org/ghc/ghc/-/blob/a952dd80d40bf6b67194a44ff71d7bf75957d29e/compiler/GHC/Core/Opt/Simplify.hs#L3071-3077
simplAlt env _ imposs_deflt_cons case_bndr' cont' (Alt DEFAULT bndrs rhs)
= assert (null bndrs) $
do