Commit 9b208ec0 authored by Adam Bergmark's avatar Adam Bergmark
Browse files

v1.1 with support for GHC<7.4 and bytestring>=0.10 combination

parent 24f820cf
......@@ -62,7 +62,7 @@ import qualified Data.ByteString.Lazy.Internal as B
import qualified Data.ByteString.Unsafe as B
#if MIN_VERSION_bytestring(0,10,4)
import Data.Word (Word8)
import Data.Monoid (mempty, (<>))
import Data.Monoid (mempty, mappend)
import qualified Data.ByteString.Builder as B
import qualified Data.ByteString.Builder.Extra as B (safeStrategy, toLazyByteStringWith)
import qualified Data.ByteString.Builder.Prim as BP
......@@ -163,12 +163,12 @@ encodeUtf8 lt@(Chunk t _) =
strategy = B.safeStrategy firstChunkSize B.defaultChunkSize
encodeUtf8Builder :: Text -> B.Builder
encodeUtf8Builder = foldrChunks (\c b -> TE.encodeUtf8Builder c <> b) mempty
encodeUtf8Builder = foldrChunks (\c b -> TE.encodeUtf8Builder c `mappend` b) mempty
{-# INLINE encodeUtf8BuilderEscaped #-}
encodeUtf8BuilderEscaped :: BP.BoundedPrim Word8 -> Text -> B.Builder
encodeUtf8BuilderEscaped prim =
foldrChunks (\c b -> TE.encodeUtf8BuilderEscaped prim c <> b) mempty
foldrChunks (\c b -> TE.encodeUtf8BuilderEscaped prim c `mappend` b) mempty
#else
encodeUtf8 (Chunk c cs) = B.Chunk (TE.encodeUtf8 c) (encodeUtf8 cs)
......
name: text
version: 1.1.1.3
version: 1.1.1.4
homepage: https://github.com/bos/text
bug-reports: https://github.com/bos/text/issues
synopsis: An efficient packed Unicode text type.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment