Proposal: die to System.Exit (and/or Prelude)

Roman Cheplyaka roma at
Mon Dec 16 14:45:38 UTC 2013

* Malcolm Wallace <malcolm.wallace at> [2013-12-16 14:17:49+0000]
> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <>

More information about the Libraries mailing list