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