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

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


On Mon, Dec 16, 2013 at 6:53 PM, Herbert Valerio Riedel <hvr at> 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: <>

More information about the Libraries mailing list