Tests if an arbitrary value is a Error case of a Result instance.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
Tests if an arbitrary value is a Error case of a Result instance.
const Result = require('folktale/result');
Result.Error.hasInstance({ value: 1 });
// ==> false
Result.Error.hasInstance(Result.Error(1));
// ==> true
Result.Error.hasInstance(Result.Ok(1));
// ==> false
hasInstance(value) {
return Boolean(value)
&& adt.hasInstance(value)
&& value[TAG] === name;
}