Russ Lewis <[EMAIL PROTECTED]> wrote: > Another newbie question: Is it possible to catch _|_ - that is, to > encounter it, handle it and continue? I'm assuming that you all are > going to say no, since I can't figure out any way to do this and retain > the functional nature of Haskell.
This isn't possible in a deterministic language, for several reasons. The IO monad, however, is non-deterministic, and its `catch' function can be used to catch any _|_ value that can be caught, specifically those arising from calls to throw, error, and certain infinite loops. It is non-deterministic, though, so it won't catch all _|_s, nor will it give any guarantee as to which _|_ it will catch (for example, in error 3 + throw (DynException (toDynamic False)) it's indeterminate whether error's return value or throw's return value will ultimately be caught. Jon Cast _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
