On Wed, 25 Mar 2009, Jonathan Cast wrote:
On Wed, 2009-03-25 at 07:39 -0400, Xiao-Yong Jin wrote:
Could you elaborate more about why this kind of breakage
wouldn't happen if 'try' is used in an IO monad as intended?
It would. But it would happen in IO, which is allowed to be
non-deterministic. Pure Haskell is not allowed to be non-deterministic.
In my opinion, 'try' catching 'error's is still a hack, since 'error's aka
bottom mean programming error. Thus catching them is debugging, bug hiding
or something worse, but not exception handling. 'try' and friends should
be limited to exceptional outcomes of IO actions, e.g. "disk full", "file
read protected" etc. There might be a variant 'unsafeTry' which can also
block 'error's.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe