@@ -217,7 +217,7 @@ import qualified Data.Text.Internal.Fusion as S
217217import qualified Data.Text.Internal.Fusion.Common as S
218218import Data.Text.Internal.Fusion (stream, reverseStream, unstream)
219219import Data.Text.Internal.Private (span_)
220−import Data.Text.Internal (Text(..), empty, firstf, mul, safe, text)
220+import Data.Text.Internal (Text(..), empty, empty_, firstf, mul, safe, text)
221221import qualified Prelude as P
222222import Data.Text.Unsafe (Iter(..), iter, iter_, lengthWord16, reverseIter,
223223 reverseIter_, unsafeHead, unsafeTail)
@@ -419,6 +419,10 @@ unpackCString# addr# = unstream (S.streamCString# addr#)
419419 unstream (S.map safe (S.streamList (GHC.unpackCStringUtf8# a)))
420420 = unpackCString# a #-}
421421
422+{-# RULES "TEXT empty literal"
423+ unstream (S.map safe (S.streamList []))
424+ = empty_ #-}
425+
422426-- | /O(1)/ Convert a character into a Text. Subject to fusion.
423427-- Performs replacement on invalid scalar values.
424428singleton :: Char -> Text