Commit 40c00afe authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Add Haddock `/Since: 4.4.0.0/` comments to symbols



This commit retroactively adds `/Since: 4.4.0.0/` annotations to symbols
newly added/exposed in `base-4.4.0.0` (as shipped with GHC 7.2.1).

See also 6368362f which adds the respective annotation for symbols newly
added in `base-4.7.0.0` (that goes together with GHC 7.8.1).
Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent 0a5ecb53
......@@ -218,6 +218,8 @@ A typical use of 'tryJust' for recovery looks like this:
--
-- When called outside 'mask', or inside 'uninterruptibleMask', this
-- function has no effect.
--
-- /Since: 4.4.0.0/
allowInterrupt :: IO ()
allowInterrupt = unsafeUnmask $ return ()
......
......@@ -187,8 +187,12 @@ ARITHMETIC_TYPE(CClock,HTYPE_CLOCK_T)
-- | Haskell type representing the C @time_t@ type.
ARITHMETIC_TYPE(CTime,HTYPE_TIME_T)
-- | Haskell type representing the C @useconds_t@ type.
--
-- /Since: 4.4.0.0/
ARITHMETIC_TYPE(CUSeconds,HTYPE_USECONDS_T)
-- | Haskell type representing the C @suseconds_t@ type.
--
-- /Since: 4.4.0.0/
ARITHMETIC_TYPE(CSUSeconds,HTYPE_SUSECONDS_T)
-- FIXME: Implement and provide instances for Eq and Storable
......
......@@ -216,6 +216,7 @@ forkIO action = IO $ \ s ->
-- only be used in that thread; the behaviour is undefined if it is
-- invoked in a different thread.
--
-- /Since: 4.4.0.0/
forkIOWithUnmask :: ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
forkIOWithUnmask io = forkIO (io unsafeUnmask)
......@@ -239,6 +240,8 @@ actual processor cores with @+RTS -qa@ if the underlying operating
system supports that, although in practice this is usually unnecessary
(and may actually degrade performance in some cases - experimentation
is recommended).
/Since: 4.4.0.0/
-}
forkOn :: Int -> IO () -> IO ThreadId
forkOn (I# cpu) action = IO $ \ s ->
......@@ -248,6 +251,8 @@ forkOn (I# cpu) action = IO $ \ s ->
-- | Like 'forkIOWithUnmask', but the child thread is pinned to the
-- given CPU, as with 'forkOn'.
--
-- /Since: 4.4.0.0/
forkOnWithUnmask :: Int -> ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
forkOnWithUnmask cpu io = forkOn cpu (io unsafeUnmask)
......@@ -266,6 +271,8 @@ numCapabilities = unsafePerformIO $ getNumCapabilities
Returns the number of Haskell threads that can run truly
simultaneously (on separate physical processors) at any given time. To change
this value, use 'setNumCapabilities'.
/Since: 4.4.0.0/
-}
getNumCapabilities :: IO Int
getNumCapabilities = do
......@@ -492,6 +499,8 @@ threadStatus (ThreadId t) = IO $ \s ->
-- running, and a boolean indicating whether the thread is locked to
-- that capability or not. A thread is locked to a capability if it
-- was created with @forkOn@.
--
-- /Since: 4.4.0.0/
threadCapability :: ThreadId -> IO (Int, Bool)
threadCapability (ThreadId t) = IO $ \s ->
case threadStatus# t s of
......
......@@ -172,6 +172,8 @@ single thread. Hence, when you use 'unsafeDupablePerformIO',
there is a possibility that the IO action may be performed multiple
times (on a multiprocessor), and you should therefore ensure that
it gives the same results each time.
/Since: 4.4.0.0/
-}
{-# NOINLINE unsafeDupablePerformIO #-}
unsafeDupablePerformIO :: IO a -> a
......
......@@ -169,6 +169,8 @@ initForeignEncoding = CodePage.mkLocaleEncoding IgnoreCodingFailure
-- This encoding never fails in either direction. However, encoding
-- discards information, so encode followed by decode is not the
-- identity.
--
-- /Since: 4.4.0.0/
char8 :: TextEncoding
char8 = Latin1.latin1
......
......@@ -45,6 +45,7 @@ import GHC.IO.Encoding.Types
latin1 :: TextEncoding
latin1 = mkLatin1 ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkLatin1 :: CodingFailureMode -> TextEncoding
mkLatin1 cfm = TextEncoding { textEncodingName = "ISO8859-1",
mkTextDecoder = latin1_DF cfm,
......@@ -73,6 +74,7 @@ latin1_EF cfm =
latin1_checked :: TextEncoding
latin1_checked = mkLatin1_checked ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkLatin1_checked :: CodingFailureMode -> TextEncoding
mkLatin1_checked cfm = TextEncoding { textEncodingName = "ISO8859-1(checked)",
mkTextDecoder = latin1_DF cfm,
......
......@@ -66,6 +66,8 @@ data BufferCodec from to state = BufferCodec {
--
-- Currently, some implementations of @recover@ may mutate the input buffer.
-- In particular, this feature is used to implement transliteration.
--
-- /Since: 4.4.0.0/
close :: IO (),
-- ^ Resources associated with the encoding may now be released.
......@@ -119,6 +121,7 @@ instance Show TextEncoding where
-- | Returns the value of 'textEncodingName'
show te = textEncodingName te
-- | /Since: 4.4.0.0/
data CodingProgress = InputUnderflow -- ^ Stopped because the input contains insufficient available elements,
-- or all of the input sequence has been sucessfully translated.
| OutputUnderflow -- ^ Stopped because the output contains insufficient free elements
......
......@@ -56,6 +56,7 @@ import GHC.IORef
utf16 :: TextEncoding
utf16 = mkUTF16 ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF16 :: CodingFailureMode -> TextEncoding
mkUTF16 cfm = TextEncoding { textEncodingName = "UTF-16",
mkTextDecoder = utf16_DF cfm,
......@@ -141,6 +142,7 @@ bom2 = bomL
utf16be :: TextEncoding
utf16be = mkUTF16be ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF16be :: CodingFailureMode -> TextEncoding
mkUTF16be cfm = TextEncoding { textEncodingName = "UTF-16BE",
mkTextDecoder = utf16be_DF cfm,
......@@ -169,6 +171,7 @@ utf16be_EF cfm =
utf16le :: TextEncoding
utf16le = mkUTF16le ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF16le :: CodingFailureMode -> TextEncoding
mkUTF16le cfm = TextEncoding { textEncodingName = "UTF16-LE",
mkTextDecoder = utf16le_DF cfm,
......
......@@ -56,6 +56,7 @@ import GHC.IORef
utf32 :: TextEncoding
utf32 = mkUTF32 ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF32 :: CodingFailureMode -> TextEncoding
mkUTF32 cfm = TextEncoding { textEncodingName = "UTF-32",
mkTextDecoder = utf32_DF cfm,
......@@ -144,6 +145,7 @@ utf32_native_encode = utf32be_encode
utf32be :: TextEncoding
utf32be = mkUTF32be ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF32be :: CodingFailureMode -> TextEncoding
mkUTF32be cfm = TextEncoding { textEncodingName = "UTF-32BE",
mkTextDecoder = utf32be_DF cfm,
......@@ -173,6 +175,7 @@ utf32be_EF cfm =
utf32le :: TextEncoding
utf32le = mkUTF32le ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF32le :: CodingFailureMode -> TextEncoding
mkUTF32le cfm = TextEncoding { textEncodingName = "UTF-32LE",
mkTextDecoder = utf32le_DF cfm,
......
......@@ -43,6 +43,7 @@ import Data.Bits
utf8 :: TextEncoding
utf8 = mkUTF8 ErrorOnCodingFailure
-- | /Since: 4.4.0.0/
mkUTF8 :: CodingFailureMode -> TextEncoding
mkUTF8 cfm = TextEncoding { textEncodingName = "UTF-8",
mkTextDecoder = utf8_DF cfm,
......
......@@ -156,6 +156,8 @@ openFile fp im =
-- This can be useful for opening a FIFO for reading: if we open in
-- non-blocking mode then the open will fail if there are no writers,
-- whereas a blocking open will block until a writer appears.
--
-- /Since: 4.4.0.0/
openFileBlocking :: FilePath -> IOMode -> IO Handle
openFileBlocking fp im =
catchException
......
......@@ -97,6 +97,8 @@ import Text.Show
--
-- Non-I\/O exceptions are not caught by this variant; to catch all
-- exceptions, use 'Control.Exception.try' from "Control.Exception".
--
-- /Since: 4.4.0.0/
tryIOError :: IO a -> IO (Either IOError a)
tryIOError f = catch (do r <- f
return (Right r))
......@@ -333,5 +335,7 @@ annotateIOError ioe loc hdl path =
--
-- Non-I\/O exceptions are not caught by this variant; to catch all
-- exceptions, use 'Control.Exception.catch' from "Control.Exception".
--
-- /Since: 4.4.0.0/
catchIOError :: IO a -> (IOError -> IO a) -> IO a
catchIOError = catch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment