
25 Nov
2013
25 Nov
'13
4:37 p.m.
On 11/24/2013 04:49 PM, Patrick Redmond wrote:
Is there a variation of 'read' which uses Maybe or Either to handle failure instead of an exception?
readMaybe: http://hackage.haskell.org/package/base-4.6.0.1/docs/Text-Read.html#v:readMa... Prelude> import Text.Read (readMaybe) Prelude Text.Read> readMaybe "Hello, World!" :: Maybe Int Nothing Prelude Text.Read> readMaybe "45" :: Maybe Int Just 45