Skip to content

What determines whether or not a function in `base` has unfolding?

I was compiling a function f whose definition uses Data.Monoid.getFirst, and it turns out when I use cabal build, the unfolding of getFirst is available to the simplifier, and so in f's unfolding, getFirst is inlined into a Coercion; whereas when I use nix build, the unfolding is not available. The GHC version and the set of optimisation flags are the same.

Since base ships with GHC I thought it should always behave exactly the same way with the same GHC version, but apparently it doesn't. What could possibly cause this to happen?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information