on master help sign in
Add `@since 1.2.2.*` annotations
3d888c2Herbert Valerio Riedel
Data/Text.hs+11−3
@@ -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]
351
351
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
355+-- provided by
356+-- the [semigroups](http://hackage.haskell.org/package/semigroups)
354−-- 'semigroups` package
357+-- package
355−
358+--
359+-- @since 1.2.2.0
356instance Semigroup Text where
360instance Semigroup Text where
357 (<>) = append
361 (<>) = append
358#endif
362#endif
@@ -415,6 +419,8 @@ instance Data Text where
415
419
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
422+--
423+-- @since 1.2.2.0
418instance PrintfArg Text where
424instance PrintfArg Text where
419 formatArg txt = formatString $ unpack txt
425 formatArg txt = formatString $ unpack txt
420#endif
426#endif
@@ -1195,6 +1201,8 @@ takeWhile p t@(Text arr off len) = loop 0
1195-- Examples:
1201-- Examples:
1196--
1202--
1197-- > takeWhileEnd (=='o') "foo" == "oo"
1203-- > takeWhileEnd (=='o') "foo" == "oo"
1204+--
1205+-- @since 1.2.2.0
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
Data/Text/Lazy.hs+11−3
@@ -343,9 +343,13 @@ instance Read Text where
343 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
343 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
344
344
345#if MIN_VERSION_base(4,9,0)
345#if MIN_VERSION_base(4,9,0)
346+-- | Non-orphan 'Semigroup' instance only defined for
346−-- Semigroup orphan instances for older GHCs are provided by
347+-- @base-4.9.0.0@ and later; orphan instances for older GHCs are
348+-- provided by
349+-- the [semigroups](http://hackage.haskell.org/package/semigroups)
347−-- 'semigroups` package
350+-- package
348−
351+--
352+-- @since 1.2.2.0
349instance Semigroup Text where
353instance Semigroup Text where
350 (<>) = append
354 (<>) = append
351#endif
355#endif
@@ -400,6 +404,8 @@ instance Data Text where
400
404
401#if MIN_VERSION_base(4,7,0)
405#if MIN_VERSION_base(4,7,0)
402-- | Only defined for @base-4.7.0.0@ and later
406-- | Only defined for @base-4.7.0.0@ and later
407+--
408+-- @since 1.2.2.0
403instance PrintfArg Text where
409instance PrintfArg Text where
404 formatArg txt = formatString $ unpack txt
410 formatArg txt = formatString $ unpack txt
405#endif
411#endif
@@ -1174,6 +1180,8 @@ takeWhile p t0 = takeWhile' t0
1174-- Examples:
1180-- Examples:
1175--
1181--
1176-- > takeWhileEnd (=='o') "foo" == "oo"
1182-- > takeWhileEnd (=='o') "foo" == "oo"
1183+--
1184+-- @since 1.2.2.0
1177takeWhileEnd :: (Char -> Bool) -> Text -> Text
1185takeWhileEnd :: (Char -> Bool) -> Text -> Text
1178takeWhileEnd p = takeChunk empty . L.reverse . toChunks
1186takeWhileEnd p = takeChunk empty . L.reverse . toChunks
1179 where takeChunk acc [] = acc
1187 where takeChunk acc [] = acc