Re: [Haskell-cafe] MonadError vs Control.Exception

2012-05-06 Thread Richard O'Keefe

On 6/05/2012, at 8:09 AM, Albert Y. C. Lai wrote:
 Exceptions appeared as early as in ML and Ada in the 1980s,

Oh they go back long before that.  PL/I had them in the 1960s
(manual 1965, compiler 1966) and Burroughs Extended Algol for
the B6700 had them in the 1970s (maybe already in 1969 when
the B6500 was released).  CLU had them in the late 70s.
The exception handling in CLU paper is 1979 and says
In referring to the condition as exceptions rather than errors
 we are following Goodenough.  The term exception is chosen
 because, unlike the term error, it does not imply that
 anything is wrong;

The 'jumpout' function in Pop2 was basically an early adoption
of the idea of continuations via Landin's J-functions; it was
used as an exception handling mechanism and that was in the
early 70s.

 Exceptions first appeared under another name in the paper of David Parnas and 
 Harald Würges response to undesired events in software systems in ICSE 1976.

Since several programming languages offered exception handling
of one sort or another well before that, that *cannot* be the
first appearance of exceptions.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] MonadError vs Control.Exception

2012-05-06 Thread Richard O'Keefe

On 7/05/2012, at 10:17 AM, Richard O'Keefe wrote:
 The 'jumpout' function in Pop2 was basically an early adoption
 of the idea of continuations via Landin's J-functions; it was
 used as an exception handling mechanism and that was in the
 early 70s.

Correction: apparently that should read 'in 1968'.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] MonadError vs Control.Exception

2012-05-05 Thread Albert Y. C. Lai

On 12-05-04 07:03 PM, Станислав Черничкин wrote:

Hi, guys, I'm interested in best practices in using of each approach.
Personally I like MonadError because it is more explicit and
Control.Exception-s becomes really ugly in complex scenarios.


[...]


User has to deal with
both, but have no evidence on none of them from type signatures or
documentation.


My opinion is largely recorded in my sarcastic
http://www.vex.net/~trebla/haskell/exception.xhtml
Be sure to click the click me if you can button and read again.

My sarcastic article focuses on control flow and doesn't comment on 
types. I agree about seeing exception possibilities in types. But that 
was done 8 years ago:

http://www.haskell.org/pipermail/haskell/2004-June/014271.html


So, I hate exceptions, I blame it, I think exceptions is junk came
from OO-world and horrible languages like C# or even more horrible
like Java, and it should be wiped out from Haskell with fire. But it
is only my humble opinion.


While you are entitled to have opinions, and I am fine with those parts 
about I hate exceptions, exceptions is junk, it is irresponsible and 
unreasonable to use that right on objective, verifiable, historical 
facts. Yes, I really hate it when people do that. I think Oleg is from 
Vulcus without even asking anyone. I think everyone uses Java without 
hard data. Programmers' habit of subsituting thinking for empirical 
facts is one of many reasons why the software profession has not yet 
earned the engineering status.


The only two responsible, reasonable positions are:

1. find the answer
or
2. hold the position that you just don't know

Exceptions appeared as early as in ML and Ada in the 1980s, before many 
people knew OO, before ML or Ada got OO stuff, before Java or C# existed 
(or when Java was an internal project under two old names at Sun), even 
before C++ got exceptions. Exceptions first appeared under another name 
in the paper of David Parnas and Harald Würges response to undesired 
events in software systems in ICSE 1976. Exceptions did not come from 
OO or languages you mentioned, and this is not about opinion.



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] MonadError vs Control.Exception

2012-05-04 Thread Станислав Черничкин
Hi, guys, I'm interested in best practices in using of each approach.
Personally I like MonadError because it is more explicit and
Control.Exception-s becomes really ugly in complex scenarios.

Here an example to illustrate my idea:
http://hackage.haskell.org/packages/archive/network-conduit/0.4.0/doc/html/src/Data-Conduit-Network.html#bindPort.
All network-conduit functions can raise IOException because of
Socket-related stuff (and actually entire network-conduit is written
to deal with IOException correctry) + Bind-port can raise ErrorCall
(came from error bindPort: addrs is empty). User has to deal with
both, but have no evidence on none of them from type signatures or
documentation. Moreover, ErrorCall in this case can be caused by
IOException (we try to bind only available address, we get IOException
exception, we have no more address to try and raise ErrorCall), and I
really don’t understand, why it should be treated in a different way.

So, I hate exceptions, I blame it, I think exceptions is junk came
from OO-world and horrible languages like C# or even more horrible
like Java, and it should be wiped out from Haskell with fire. But it
is only my humble opinion. Reality shows that Haskell provides
extensive support for exceptions, it included in base libraries and
everyone uses it, but MonadError is modest part of mtl, and don’t even
have “bracket” and other useful functions. That is why I’m really
interested in any your ideas and experience on using these approaches.

Cheers, Stasik.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe