Created
September 13, 2019 19:48
-
-
Save evaporei/a17ed6deabb781285caad35b0a5257ca to your computer and use it in GitHub Desktop.
Category Theory - Monoid Integer Sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Number.prototype.mappend = function (x: Number): Number { | |
| return this + x | |
| } | |
| Number.prototype.mempty = function (): Number { | |
| return 0 | |
| } | |
| console.log('mappend:', Number(5).mappend(4)) // 9 | |
| console.log('mempty:', Number().mempty()) // 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment