isBottom a returns False if a is distinct from bottom. If
a equals bottom and results in an exception which is caught by
isBottom, and this exception is of a certain kind (see below),
then isBottom a = True. Other caught exceptions are
re-thrown. If a never reaches a weak head normal form and
never throws an exception, then isBottom a never terminates.
The exceptions that yield True are those that correspond to
"pure bottoms", i.e. bottoms that can originate in pure code.
Assertions are excluded, since their behaviour depends on compiler
flags (not pure, and a failed assertion should really yield an
exception and nothing else). The same applies to arithmetic
exceptions (machine dependent, except possibly for
Control.Exception.DivideByZero, but the value infinity makes that
case unclear as well).
|
isBottomTimeOut timeOutLimit works like isBottom, but if
timeOutLimit is Just lim, then computations taking more than
lim seconds are also considered to be equal to bottom. Note that
this is a very crude approximation of what a bottom is. Also note
that this "function" may return different answers upon different
invocations. Take it for what it is worth.
isBottomTimeOut is subject to all the same scheduling vagaries as
Test.ChasingBottoms.TimeOut.timeOut.
|