@@ -350,9 +350,13 @@ instance Read Text where
350 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
350 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
352#if MIN_VERSION_base(4,9,0)
352#if MIN_VERSION_base(4,9,0)
353+-- | Non-orphan 'Semigroup' instance only defined for
353−-- Semigroup orphan instances for older GHCs are provided by
354+-- @base-4.9.0.0@ and later; orphan instances for older GHCs are
356+-- the [semigroups](http://hackage.haskell.org/package/semigroups)
354−-- 'semigroups` package
357+-- package
356instance Semigroup Text where
360instance Semigroup Text where
357 (<>) = append
361 (<>) = append
@@ -415,6 +419,8 @@ instance Data Text where
416#if MIN_VERSION_base(4,7,0)
420#if MIN_VERSION_base(4,7,0)
417-- | Only defined for @base-4.7.0.0@ and later
421-- | Only defined for @base-4.7.0.0@ and later
418instance PrintfArg Text where
424instance PrintfArg Text where
419 formatArg txt = formatString $ unpack txt
425 formatArg txt = formatString $ unpack txt
@@ -1195,6 +1201,8 @@ takeWhile p t@(Text arr off len) = loop 0
1195-- Examples:
1201-- Examples:
1197-- > takeWhileEnd (=='o') "foo" == "oo"
1203-- > takeWhileEnd (=='o') "foo" == "oo"
1198takeWhileEnd :: (Char -> Bool) -> Text -> Text
1206takeWhileEnd :: (Char -> Bool) -> Text -> Text
1199takeWhileEnd p t@(Text arr off len) = loop (len-1) len
1207takeWhileEnd p t@(Text arr off len) = loop (len-1) len
1200 where loop !i !l | l <= 0 = t
1208 where loop !i !l | l <= 0 = t