Last active
April 4, 2019 00:51
-
-
Save dewey92/ad8d6fbdefb4c5348b6118de31a0ef97 to your computer and use it in GitHub Desktop.
Num Add Monoid
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
| const numAddition = createMonoid({ | |
| indentity: 0, | |
| semigroup: (a, b) => a + b, | |
| }); | |
| log(numAddition.id) // => 0 | |
| log(numAddition.append(1, 2)) // => 3 | |
| log(numAddition.append(3, numAddition.id)) // => 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment