The case of the mysterious explosion in space  The case of the
mysterious explosion in space  A few months ago, reports began
to filter in of an unhappy problem with the Haskell text
package: it was causing huge object files to be generated when a
file contained lots of string literals.  I didn’t notice the
initial report (it was posted to a busy mailing list that I
don’t try to keep up with), but Michael Snoyman was kind enough
to take that message and file a bug.  The culprit was this very
simple function definition, which converts a string from the
venerable Haskell String type to the more modern Text.  pack ::
String -> Text pack txt = unstream              ( safe
(Stream.streamList txt))  The definition of pack is too innocent
to be at fault; the problem lies with the extra directives that
text gives to the compiler.  {-# INLINE pack #-} {-# INLINE
Stream.unstream #-} {-# INLINE #-} {-# INLINE Stream.streamList
#-}  By asking the compiler to inline every function, we
guaranteed that every stri