
16 Dec
2013
16 Dec
'13
9:45 a.m.
* Malcolm Wallace
I see no good reason to distinguish between runtime pattern-match failure, and a direct user call of "fail".
One reason to distinguish them is that there's no good reason for fail to have type String -> m a. Perhaps a better type would be PatternFailureInfo -> m a, where PatternFailureInfo would include the SrcLoc of where the failure happened, the pattern itself, maybe something else. So, it is possible to use fail in parsers, but only because it incidentally has such a loose type. That's why it looks like a hack to me. Roman