Michael Abbott writes:
Using GHC 2.02, where has
try :: IO a - Either IOError a
got to?
According to my copy of the "Standard Libraries for the Haskell
Programming Language", Version 1.4, the IO library exports:
hWaitForInput, try, bracket, bracket_.
I can't find any
I would really welcome feedback on this proposal. Have you encountered
situations in which pattern guards would be useful? Can you think of ways
in which they might be harmful, or in which their semantics is non-obvious?
Are there ways in which the proposal could be improved? And so on.
I found Simon Peyton Jones' proposal for guarded equations very
interesting and convincing. However, I see situations where yet more
flexibility in guarded expressions would be useful, and I have included
a suggestion for an extension below. I hope the following is
understandable and makes sense,
| We can avoid both the case expressions and the helper function by Simon
| Peyton Jones' guard syntax
|
| -- version 3
| simplify (Plus e e') | s - simplify e ,
|s' - simplify e',
|(Val 0) - s
| = s'
|
I love Simon's suggestion. It gives me all the right vibes. And - seems to
me to be the right connective to use.
At the risk of beating my hobby horse, let's not think of - solely in
terms of monads. It is certainly appropriate there, but it is also
appropriate for lists when thought of purely
Simon (PJ) sez:
Is this a storm in a teacup? Much huff and puff for a seldom-occurring
situation? No! It happens to me ALL THE TIME.
I have to join Simon out of the closet, and confess that I write
Clunky Functions rather a lot too, or at least find myself going to
significant lengths to
simonpj's proposal on guards:
I would really welcome feedback on this proposal. Have you encountered
situations in which pattern guards would be useful? Can you think of ways
in which they might be harmful, or in which their semantics is non-obvious?
Are there ways in which the