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

Akio Takano tkn.akio at gmail.com
Wed Dec 18 07:15:57 UTC 2013


Hi,

On Mon, Dec 16, 2013 at 6:53 PM, Herbert Valerio Riedel <hvr at gnu.org> wrote:

>
> Why not simply use the existing `fail :: String -> IO a` method instead?
>
> The differences & similiarities I see wrt `fail`:
>
>  - `die` throws an `ExitCode` exception, whereas `fail` throws an
>    `IOError` exception
>
>  - Both result in the message written to stderr and a non-zero exit code
>

One problem with 'fail' is that the error message is surrounded by "user
error (" and ")". This is ok for debugging, but it can be confusing for the
end user.

Add System.Exit.die:            +1
Re-export it from Prelude:      +0

Takano Akio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131218/e71b59ce/attachment.html>


More information about the Libraries mailing list