on master help sign in
Add `@since 1.0.0.0` annotations
3ca519bHerbert Valerio Riedel
Data/Text.hs+2
@@ -811,6 +811,8 @@ toUpper t = unstream (S.toUpper (stream t))
811-- guides disagree on whether the book name \"The Hill of the Red
811-- guides disagree on whether the book name \"The Hill of the Red
812-- Fox\" is correctly title cased—but this function will
812-- Fox\" is correctly title cased—but this function will
813-- capitalize /every/ word.
813-- capitalize /every/ word.
814+--
815+-- @since 1.0.0.0
814toTitle :: Text -> Text
816toTitle :: Text -> Text
815toTitle t = unstream (S.toTitle (stream t))
817toTitle t = unstream (S.toTitle (stream t))
816{-# INLINE toTitle #-}
818{-# INLINE toTitle #-}
Data/Text/Encoding.hs+6
@@ -213,6 +213,8 @@ decodeUtf8With onErr (PS fp off len) = runText $ \done -> do
213-- or continuation where it is encountered.
213-- or continuation where it is encountered.
214
214
215-- | A stream oriented decoding result.
215-- | A stream oriented decoding result.
216+--
217+-- @since 1.0.0.0
216data Decoding = Some Text ByteString (ByteString -> Decoding)
218data Decoding = Some Text ByteString (ByteString -> Decoding)
217
219
218instance Show Decoding where
220instance Show Decoding where
@@ -232,11 +234,15 @@ newtype DecoderState = DecoderState Word32 deriving (Eq, Show, Num, Storable)
232-- thrown (either by this function or a continuation) that cannot be
234-- thrown (either by this function or a continuation) that cannot be
233-- caught in pure code. For more control over the handling of invalid
235-- caught in pure code. For more control over the handling of invalid
234-- data, use 'streamDecodeUtf8With'.
236-- data, use 'streamDecodeUtf8With'.
237+--
238+-- @since 1.0.0.0
235streamDecodeUtf8 :: ByteString -> Decoding
239streamDecodeUtf8 :: ByteString -> Decoding
236streamDecodeUtf8 = streamDecodeUtf8With strictDecode
240streamDecodeUtf8 = streamDecodeUtf8With strictDecode
237
241
238-- | Decode, in a stream oriented way, a 'ByteString' containing UTF-8
242-- | Decode, in a stream oriented way, a 'ByteString' containing UTF-8
239-- encoded text.
243-- encoded text.
244+--
245+-- @since 1.0.0.0
240streamDecodeUtf8With :: OnDecodeError -> ByteString -> Decoding
246streamDecodeUtf8With :: OnDecodeError -> ByteString -> Decoding
241streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
247streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
242 where
248 where
Data/Text/Foreign.hs+4
@@ -157,6 +157,8 @@ asForeignPtr t@(Text _arr _off len) = do
157-- | /O(n)/ Decode a C string with explicit length, which is assumed
157-- | /O(n)/ Decode a C string with explicit length, which is assumed
158-- to have been encoded as UTF-8. If decoding fails, a
158-- to have been encoded as UTF-8. If decoding fails, a
159-- 'UnicodeException' is thrown.
159-- 'UnicodeException' is thrown.
160+--
161+-- @since 1.0.0.0
160peekCStringLen :: CStringLen -> IO Text
162peekCStringLen :: CStringLen -> IO Text
161peekCStringLen cs = do
163peekCStringLen cs = do
162 bs <- unsafePackCStringLen cs
164 bs <- unsafePackCStringLen cs
@@ -169,5 +171,7 @@ peekCStringLen cs = do
169-- The temporary storage is freed when the subcomputation terminates
171-- The temporary storage is freed when the subcomputation terminates
170-- (either normally or via an exception), so the pointer to the
172-- (either normally or via an exception), so the pointer to the
171-- temporary storage must /not/ be used after this function returns.
173-- temporary storage must /not/ be used after this function returns.
174+--
175+-- @since 1.0.0.0
172withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
176withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
173withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act
177withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act
Data/Text/Lazy.hs+2
@@ -830,6 +830,8 @@ toUpper t = unstream (S.toUpper (stream t))
830-- guides disagree on whether the book name \"The Hill of the Red
830-- guides disagree on whether the book name \"The Hill of the Red
831-- Fox\" is correctly title cased&#x2014;but this function will
831-- Fox\" is correctly title cased&#x2014;but this function will
832-- capitalize /every/ word.
832-- capitalize /every/ word.
833+--
834+-- @since 1.0.0.0
833toTitle :: Text -> Text
835toTitle :: Text -> Text
834toTitle t = unstream (S.toTitle (stream t))
836toTitle t = unstream (S.toTitle (stream t))
835{-# INLINE toTitle #-}
837{-# INLINE toTitle #-}