Tests if an arbitrary value is a Ok case of a Result instance.
Tests if an arbitrary value is a Ok case of a Result instance.
const Result = require('folktale/result');
Result.Ok.hasInstance({ value: 1 });
// ==> false
Result.Ok.hasInstance(Result.Error(1));
// ==> false
Result.Ok.hasInstance(Result.Ok(1));
// ==> true
hasInstance(value) {
return Boolean(value)
&& adt.hasInstance(value)
&& value[TAG] === name;
}