In Chapter 8 of thinking with types I learned that the fmap Sum part of
fastSum :: [Int] -> Int
fastSum = getSum . mconcat . fmap Sum
has a O(n) runtime cost, whereas using coerce instead avoids that overhead.
I know newtypes have no representation overhead, but what I do not understand is what is the runtime effect of mapping a newtype constructor over a list. I thought this would only have a compile-time overhead, and it should be just O(1), since the compiler only needs to know the type of the fmap SomeNewtypeCtr expression.