Skip to content

Instantly share code, notes, and snippets.

View scornork's full-sized avatar

scornork scornork

  • Singapore
View GitHub Profile
@scornork
scornork / utils.either.js
Last active January 26, 2025 12:32
Implementation of the Either monad in a closure.
const Either = Object.freeze((() => {
const Right = input => ({
get isRight () {
return _ => true;
},
get isLeft () {
return _ => false;
},