
21 Jun
2008
21 Jun
'08
3:46 p.m.
Don Stewart
The main thing is to define a safe read. This will be in the base library soon,
maybeRead :: Read a => String -> Maybe a maybeRead s = case reads s of [(x, "")] -> Just x _ -> Nothing
Then you can pattern match on the failure case as Nothing.
When will it be in the base library? X-Y -- c/* __o/* <\ * (__ */\ <