File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
unicode-data/lib/Unicode/Char Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,16 @@ numericValue = V.numericValue
9696-- This is a special case of 'numericValue'.
9797--
9898-- __Warning:__ There is a risk of /integer overflow/ depending of the chosen
99- -- concrete return type. As of Unicode 15.0 the results range from 0 to 1e12.
100- --
101- -- >>> integerValue '\x5146' :: Maybe Int64 -- OK
102- -- Just 1000000000000
103- -- >>> integerValue '\x5146' :: Maybe Int32 -- Will overflow!
104- -- Just (-727379968)
99+ -- concrete return type. As of Unicode 15.1 the results range from 0 to 1e16.
100+ --
101+ -- >>> minimum [v | v@Just{} <- integerValue <$> [minBound..]] :: Maybe Integer
102+ -- Just 0
103+ -- >>> maximum (integerValue <$> [minBound..]) :: Maybe Integer
104+ -- Just 10000000000000000
105+ -- >>> integerValue '\x4EAC' :: Maybe Int64 -- OK
106+ -- Just 10000000000000000
107+ -- >>> integerValue '\x4EAC' :: Maybe Int32 -- Will overflow!
108+ -- Just 1874919424
105109--
106110-- Therefore it is advised to use: @'integerValue' \@'Int64'@.
107111--
You can’t perform that action at this time.
0 commit comments