Created
September 13, 2019 19:49
-
-
Save evaporei/10317ddd1d63f3ef420309b4ff1cd682 to your computer and use it in GitHub Desktop.
Category Theory - Monoid Integer Multiplication
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 1 | |
| } | |
| console.log('mappend:', Number(5).mappend(4)) // 20 | |
| console.log('mempty:', Number().mempty()) // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment