On Tue, 23 Nov 2004, John Goerzen wrote: (snip) > I've been using Haskell for 1-2 months now, and feel fairly comfortable (snip) > catchJust :: (Exception -> Maybe b) -> (c -> a) -> c -> (b -> a) -> a (snip)
Yes, this was one of the first things that bothered me, too, when I started actually writing much Haskell code: I wanted a non-monadic version of try/catch. Because a pure function should always return the same value given the same arguments, the behaviour of such a try/catch must be made quite deterministic: for example, perhaps it should only return exceptions generated in its own execution thread (to make it entirely synchronous), and perhaps all the exceptions that could be generated in its evaluation should be generated (so we don't learn anything about evaluation order - after the first exception, we may need to carry on evaluating other parts of the expression to find what other exceptions there are). I seem to have learned to live with the lack of such non-monadic exceptions: often I use monads for this sort of error propagation thing, but not the standard try/catch in the IO monad because I avoid the IO monad wherever possible because functions in the IO monad are so unconstrained by the type system with regard to what effects they could have. -- Mark _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell