on master help sign in
Add `@since 1.2.2.*` annotations
commit3d888c2dab4f00660ed53c6dafeeafd6f179bdcb authorHerbert Valerio Riedel <hvr@gnu.org> dateSat 23 Dec 2017, 19:07 (9 years ago) parent596f523
2 files changed+22−6
Data/Text.hs+11−3 Data/Text/Lazy.hs+11−3
Data/Text.hs+11−3
@@ -350,9 +350,13 @@ instance Read Text where
350350 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
351351
352352#if MIN_VERSION_base(4,9,0)
353−-- Semigroup orphan instances for older GHCs are provided by
354−-- 'semigroups` package
355−
353+-- | Non-orphan 'Semigroup' instance only defined for
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)
357+-- package
358+--
359+-- @since 1.2.2.0
356360instance Semigroup Text where
357361 (<>) = append
358362#endif
@@ -415,6 +419,8 @@ instance Data Text where
415419
416420#if MIN_VERSION_base(4,7,0)
417421-- | Only defined for @base-4.7.0.0@ and later
422+--
423+-- @since 1.2.2.0
418424instance PrintfArg Text where
419425 formatArg txt = formatString $ unpack txt
420426#endif
@@ -1195,6 +1201,8 @@ takeWhile p t@(Text arr off len) = loop 0
11951201-- Examples:
11961202--
11971203-- > takeWhileEnd (=='o') "foo" == "oo"
1204+--
1205+-- @since 1.2.2.0
11981206takeWhileEnd :: (Char -> Bool) -> Text -> Text
11991207takeWhileEnd p t@(Text arr off len) = loop (len-1) len
12001208 where loop !i !l | l <= 0 = t
Data/Text/Lazy.hs+11−3
@@ -343,9 +343,13 @@ instance Read Text where
343343 readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
344344
345345#if MIN_VERSION_base(4,9,0)
346−-- Semigroup orphan instances for older GHCs are provided by
347−-- 'semigroups` package
348−
346+-- | Non-orphan 'Semigroup' instance only defined for
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)
350+-- package
351+--
352+-- @since 1.2.2.0
349353instance Semigroup Text where
350354 (<>) = append
351355#endif
@@ -400,6 +404,8 @@ instance Data Text where
400404
401405#if MIN_VERSION_base(4,7,0)
402406-- | Only defined for @base-4.7.0.0@ and later
407+--
408+-- @since 1.2.2.0
403409instance PrintfArg Text where
404410 formatArg txt = formatString $ unpack txt
405411#endif
@@ -1174,6 +1180,8 @@ takeWhile p t0 = takeWhile' t0
11741180-- Examples:
11751181--
11761182-- > takeWhileEnd (=='o') "foo" == "oo"
1183+--
1184+-- @since 1.2.2.0
11771185takeWhileEnd :: (Char -> Bool) -> Text -> Text
11781186takeWhileEnd p = takeChunk empty . L.reverse . toChunks
11791187 where takeChunk acc [] = acc