
7 Feb
2008
7 Feb
'08
10:52 p.m.
On Thu, Feb 07, 2008 at 03:20:31PM -0500, Jeff Polakow wrote:
Why not allow an arbitrary monad?
readM :: (Monad m, Read a) => String -> String -> m a readM errMsg s = case reads s of [(x, "")] -> return x _ -> fail errMsg
Yes. I strongly support this, this routine has been in my GenUtil for a long time as is hella useful. Though, I wouldn't give it an error message argument and just let it have something descriptive like "readM: no parse" as in my other reply. John -- John Meacham - ⑆repetae.net⑆john⑈