Re: Decorating exceptions with backtrace information

Niklas Hambüchen <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe,gmane.comp.lang.haskell.glasgow.user,gmane.comp.lang.haskell.ghc.devel
Message-ID <[email protected]>
On 5/12/20 10:55 PM, Henning Thielemann wrote:
> "This operation may fail with:
> 
> * ResourceVanished if the handle is a pipe or socket, and the reading end is closed."
> 
> That is, ResourceVanished is part of the public interface and in no way unexpected (or what "unintended" may be). I would prefer to make this explicit in the type of hPutBuf:
> 
> hPutBuf ::
>    (ResourceVanishedException e) =>
>    Handle -> Ptr a -> Int -> ExceptT e IO ()
> 
> Now, what do you intend to do with the call-stack? Isn't it something you can attach to the e value?

Why is this relevant?

The point of debugging is to find programming errors.
It does not matter what the Haddocks say; if a programmer uses the function wrong, the exception will occur.

hPutBuf does not currently have that type, nor can anybody rewrite all the existing libraries easily.

The point of the proposal is to make the RTS help us debug problems in code as it exists today.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.