During encoding, we used to create a list of builders for the fields of a protobuf message and then make a call to mconcat on the message builder type. But mconcat is recursive and therefore cannot be inlined as such, and GHC seems reluctant to perform beta reduction on known constructors such as (:) across module boundaries.
Therefore this commit switches from "mconcat [x, y, z]" to "mappend (mappend x y) z" (for example). These appends are left associativity because the builder writes in reverse, starting with the rightmost field.
During encoding, we used to create a list of builders for the fields of a protobuf message and then make a call to mconcat on the message builder type. But mconcat is recursive and therefore cannot be inlined as such, and GHC seems reluctant to perform beta reduction on known constructors such as (:) across module boundaries.
Therefore this commit switches from "mconcat [x, y, z]" to "mappend (mappend x y) z" (for example). These appends are left associativity because the builder writes in reverse, starting with the rightmost field.