Onga inc

subtitle

js-design-monads

1
2
3
4
5
6
7
8
9
10
function Identity(value) {
this.value = value;
}

Identity.prototype.bind = function(transform) {
return transform(this.value);
};

Identity.prototype.toString = function() {
return 'Identity(' + this.value + ')';

参考

JavaScriptのモナド
http://postd.cc/monads-in-javascript/

Onga

A designer, developer and entrepreneur. Spends his time travelling the world with a bag of kites. Likes journalism and publishing platforms.

Comments