// Note: these first 3 syntaxes seem to be wrong
// (not failing on timeout)
static O evalWithTimeoutOrException(fO f, int timeoutMS) {
ret evalWithTimeoutOrException(timeoutMS, f);
}
static O evalWithTimeoutOrException(int timeoutMS, fO f) {
ret eitherAOpt(evalWithTimeout(timeoutMS, f));
}
static O evalWithTimeoutOrException(double timeoutSeconds, fO f) {
ret eitherAOpt(evalWithTimeout(timeoutSeconds, f));
}
// the following 4 syntaxes are ok
static A evalWithTimeoutOrException(int timeoutMS, F0 f) {
Either e = evalWithTimeout(timeoutMS, f);
if (e.isA()) ret (A) e.a();
fail(trim("Timeout after " + timeoutMS + " ms. "
+ unnull(stackTraceForThread(e.b()))));
}
static A evalWithTimeoutOrException(double timeoutSeconds, F0 f) {
ret evalWithTimeoutOrException(toMS_int(timeoutSeconds), f);
}
static A evalWithTimeoutOrException(int timeoutMS, IF0 f) {
ret evalWithTimeoutOrException(timeoutMS, if0ToF0(f));
}
static A evalWithTimeoutOrException(double timeoutSeconds, IF0 f) {
ret evalWithTimeoutOrException(timeoutSeconds, if0ToF0(f));
}