Source

text / Data / Text / Read.hs

Diff from to

File Data/Text/Read.hs

 --
 -- /Note/: For fixed-width integer types, this function does not
 -- attempt to detect overflow, so a sufficiently long input may give
--- incorrect results.
+-- incorrect results.  If you are worried about overflow, use
+-- 'Integer' for your result type.
 decimal :: Integral a => Reader a
 {-# SPECIALIZE decimal :: Reader Int #-}
 {-# SPECIALIZE decimal :: Reader Integer #-}
 --
 -- /Note/: For fixed-width integer types, this function does not
 -- attempt to detect overflow, so a sufficiently long input may give
--- incorrect results.
+-- incorrect results.  If you are worried about overflow, use
+-- 'Integer' for your result type.
 hexadecimal :: Integral a => Reader a
 {-# SPECIALIZE hexadecimal :: Reader Int #-}
 {-# SPECIALIZE hexadecimal :: Reader Integer #-}
 -- by the 'read' function, with the exception that a trailing @\'.\'@
 -- or @\'e\'@ /not/ followed by a number is not consumed.
 --
--- Examples:
+-- Examples (with behaviour identical to 'read'):
 --
 -- >rational "3"     == Right (3.0, "")
 -- >rational "3.1"   == Right (3.1, "")