Skip to content
  • Herbert Valerio Riedel's avatar
    Add `Distribution.Simple.Utils.ShortText` type (#3898) · 993d20a2
    Herbert Valerio Riedel authored
    This implements a type with a compact representation of `[Char]`.
    
    The data is stored internally as UTF8 in an 'Data.ByteString.Short.ShortByteString'
    when compiled against `bytestring >= 0.10.4`, and otherwise in a
    plain old `[Char]`.
    
    `ShortByteString` is available only from `bytestring` 0.10.4 on, and GHC
    7.8.4 was the first GHC to bundle `binary-0.10.4`. So this fallback
    affects mostly only GHC 7.6 and older.
    
    Note: Originally a strict `ByteString` was used as fallback for this patch. However, the 
    `[Char]` fallback avoids pinned memory and may be more preferable when dealing with
    many small `ShortText`s
    993d20a2