Try<T> static method
Implementation
static Validation<T> Try<T>(T Function() f, {String failMessage = ''}) {
try{
return Valid(f());
}
catch (e)
{
final fail = e is Exception ? Fail.withException(e, message: failMessage)
: Fail.withError(e as Error, message: failMessage);
return Invalid<T>([fail]);
}
}