
12 Dec
2011
12 Dec
'11
10:24 a.m.
On Thu, Dec 8, 2011 at 10:39 PM, Iavor Diatchki
Hello,
when writing simple String parsers, I find implementing this function over and over:
readEither :: Read a => String -> Either String a
The only thing that bothers me about this is the fact that the error is a String; I don't think that's a very good type for errors, because only humans can really effectively interpret it. I don't know whether it's worth introducing a new sum type just for the different kinds of read error. Regardless, readMaybe is definitely a good idea, so +1 for that.