Open getify opened 2 years ago
In addition to things like IO.is(x) to determine if x is an IO monad instance, we can add Symbol.hasInstance to all the monad definitions so that a more ergonomic x isntanceof IO check will work properly.
IO.is(x)
x
Symbol.hasInstance
x isntanceof IO
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance
In addition to things like
IO.is(x)
to determine ifx
is an IO monad instance, we can addSymbol.hasInstance
to all the monad definitions so that a more ergonomicx isntanceof IO
check will work properly.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance