summaryrefslogtreecommitdiff
path: root/libraries/base/Text
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-09-21 18:04:19 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-09-21 18:07:25 +0200
commit2642d9f6eac5879c7d38bc51726bede1bef77df4 (patch)
treed35215ec3086549a77a05fc273be678e3646c327 /libraries/base/Text
parent77f32dad3bef5b641a9d15f69ad2e0f058ade67a (diff)
downloadhaskell-2642d9f6eac5879c7d38bc51726bede1bef77df4.tar.gz
Add Haddock `/Since: 4.6.0.0/` comments to symbols
This commit retroactively adds `/Since: 4.6.0.0/` annotations to symbols newly added/exposed in `base-4.6.0.0` (as shipped with GHC 7.6.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 <hvr@gnu.org>
Diffstat (limited to 'libraries/base/Text')
-rw-r--r--libraries/base/Text/Read.hs4
-rw-r--r--libraries/base/Text/Read/Lex.hs2
2 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/Text/Read.hs b/libraries/base/Text/Read.hs
index b2c3d6bfc7..6c9d89db76 100644
--- a/libraries/base/Text/Read.hs
+++ b/libraries/base/Text/Read.hs
@@ -62,6 +62,8 @@ reads = readsPrec minPrec
-- | Parse a string using the 'Read' instance.
-- Succeeds if there is exactly one valid result.
-- A 'Left' value indicates a parse error.
+--
+-- /Since: 4.6.0.0/
readEither :: Read a => String -> Either String a
readEither s =
case [ x | (x,"") <- readPrec_to_S read' minPrec s ] of
@@ -76,6 +78,8 @@ readEither s =
-- | Parse a string using the 'Read' instance.
-- Succeeds if there is exactly one valid result.
+--
+-- /Since: 4.6.0.0/
readMaybe :: Read a => String -> Maybe a
readMaybe s = case readEither s of
Left _ -> Nothing
diff --git a/libraries/base/Text/Read/Lex.hs b/libraries/base/Text/Read/Lex.hs
index 28bad33852..f2ef4cc922 100644
--- a/libraries/base/Text/Read/Lex.hs
+++ b/libraries/base/Text/Read/Lex.hs
@@ -61,6 +61,7 @@ data Lexeme
| EOF
deriving (Eq, Show)
+-- | /Since: 4.6.0.0/
data Number = MkNumber Int -- Base
Digits -- Integral part
| MkDecimal Digits -- Integral part
@@ -130,6 +131,7 @@ numberToRangedRational (neg, pos) n@(MkDecimal iPart mFPart (Just exp))
else Just (numberToRational n)
numberToRangedRational _ n = Just (numberToRational n)
+-- | /Since: 4.6.0.0/
numberToRational :: Number -> Rational
numberToRational (MkNumber base iPart) = val (fromIntegral base) 0 iPart % 1
numberToRational (MkDecimal iPart mFPart mExp)