
14 May
2015
14 May
'15
11:23 a.m.
On 05/14/2015 06:25 AM, Kostiantyn Rybnikov wrote:
Hi Dananji!
First of all, for more explicit failure-handling I suggest using "readMay" from package "safe" [0] instead of "read" whenever possible.
This is always a good idea, and someone finally added it to the base library (in 4.6.0.0) as "readMaybe". ghci> import Text.Read ( readMaybe ) ghci> readMaybe "Hello, world!" :: Maybe Integer Nothing