on master help sign in
Add `@since 1.0.0.0` annotations
commit3ca519ba78793f57c5c14ae95913e871e57a6e86 authorHerbert Valerio Riedel <hvr@gnu.org> dateSat 23 Dec 2017, 18:25 (9 years ago) parent336135b
4 files changed+14
Data/Text.hs+2 Data/Text/Encoding.hs+6 Data/Text/Foreign.hs+4 Data/Text/Lazy.hs+2
Data/Text.hs+2
@@ -811,6 +811,8 @@ toUpper t = unstream (S.toUpper (stream t))
811811-- guides disagree on whether the book name \"The Hill of the Red
812812-- Fox\" is correctly title cased&#x2014;but this function will
813813-- capitalize /every/ word.
814+--
815+-- @since 1.0.0.0
814816toTitle :: Text -> Text
815817toTitle t = unstream (S.toTitle (stream t))
816818{-# INLINE toTitle #-}
Data/Text/Encoding.hs+6
@@ -213,6 +213,8 @@ decodeUtf8With onErr (PS fp off len) = runText $ \done -> do
213213-- or continuation where it is encountered.
214214
215215-- | A stream oriented decoding result.
216+--
217+-- @since 1.0.0.0
216218data Decoding = Some Text ByteString (ByteString -> Decoding)
217219
218220instance Show Decoding where
@@ -232,11 +234,15 @@ newtype DecoderState = DecoderState Word32 deriving (Eq, Show, Num, Storable)
232234-- thrown (either by this function or a continuation) that cannot be
233235-- caught in pure code. For more control over the handling of invalid
234236-- data, use 'streamDecodeUtf8With'.
237+--
238+-- @since 1.0.0.0
235239streamDecodeUtf8 :: ByteString -> Decoding
236240streamDecodeUtf8 = streamDecodeUtf8With strictDecode
237241
238242-- | Decode, in a stream oriented way, a 'ByteString' containing UTF-8
239243-- encoded text.
244+--
245+-- @since 1.0.0.0
240246streamDecodeUtf8With :: OnDecodeError -> ByteString -> Decoding
241247streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
242248 where
Data/Text/Foreign.hs+4
@@ -157,6 +157,8 @@ asForeignPtr t@(Text _arr _off len) = do
157157-- | /O(n)/ Decode a C string with explicit length, which is assumed
158158-- to have been encoded as UTF-8. If decoding fails, a
159159-- 'UnicodeException' is thrown.
160+--
161+-- @since 1.0.0.0
160162peekCStringLen :: CStringLen -> IO Text
161163peekCStringLen cs = do
162164 bs <- unsafePackCStringLen cs
@@ -169,5 +171,7 @@ peekCStringLen cs = do
169171-- The temporary storage is freed when the subcomputation terminates
170172-- (either normally or via an exception), so the pointer to the
171173-- temporary storage must /not/ be used after this function returns.
174+--
175+-- @since 1.0.0.0
172176withCStringLen :: Text -> (CStringLen -> IO a) -> IO a
173177withCStringLen t act = unsafeUseAsCStringLen (encodeUtf8 t) act
Data/Text/Lazy.hs+2
@@ -830,6 +830,8 @@ toUpper t = unstream (S.toUpper (stream t))
830830-- guides disagree on whether the book name \"The Hill of the Red
831831-- Fox\" is correctly title cased&#x2014;but this function will
832832-- capitalize /every/ word.
833+--
834+-- @since 1.0.0.0
833835toTitle :: Text -> Text
834836toTitle t = unstream (S.toTitle (stream t))
835837{-# INLINE toTitle #-}