on master help sign in
Add `@since 1.2.0.*` annotations
commit754a01dd73df3790439a3de3ac86407e2a02db4f authorHerbert Valerio Riedel <hvr@gnu.org> dateSat 23 Dec 2017, 18:55 (9 years ago) parent18fbd5e
2 files changed+8
Data/Text.hs+1 Data/Text/Lazy.hs+7
Data/Text.hs+1
@@ -370,6 +370,7 @@ instance IsString Text where
370370 fromString = pack
371371
372372#if __GLASGOW_HASKELL__ >= 708
373+-- | @since 1.2.0.0
373374instance Exts.IsList Text where
374375 type Item Text = Char
375376 fromList = pack
Data/Text/Lazy.hs+7
@@ -363,6 +363,7 @@ instance IsString Text where
363363 fromString = pack
364364
365365#if __GLASGOW_HASKELL__ >= 708
366+-- | @since 1.2.0.0
366367instance Exts.IsList Text where
367368 type Item Text = Char
368369 fromList = pack
@@ -984,6 +985,8 @@ mapAccumR f = go
984985
985986-- | @'repeat' x@ is an infinite 'Text', with @x@ the value of every
986987-- element.
988+--
989+-- @since 1.2.0.5
987990repeat :: Char -> Text
988991repeat c = let t = Chunk (T.replicate smallChunkSize (T.singleton c)) t
989992 in t
@@ -1001,6 +1004,8 @@ replicate n t
10011004
10021005-- | 'cycle' ties a finite, non-empty 'Text' into a circular one, or
10031006-- equivalently, the infinite repetition of the original 'Text'.
1007+--
1008+-- @since 1.2.0.5
10041009cycle :: Text -> Text
10051010cycle Empty = emptyError "cycle"
10061011cycle t = let t' = foldrChunks Chunk t' t
@@ -1010,6 +1015,8 @@ cycle t = let t' = foldrChunks Chunk t' t
10101015-- of @f@ to @x@:
10111016--
10121017-- > iterate f x == [x, f x, f (f x), ...]
1018+--
1019+-- @since 1.2.0.5
10131020iterate :: (Char -> Char) -> Char -> Text
10141021iterate f c = let t c' = Chunk (T.singleton c') (t (f c'))
10151022 in t c