Last active
April 4, 2019 01:00
-
-
Save dewey92/839dd1d386dcc902df630c35be01e655 to your computer and use it in GitHub Desktop.
String 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 string = createMonoid({ | |
| indentity: '', | |
| semigroup: (a, b) => a + b, | |
| }); | |
| log(string.id) // => '' | |
| log(string.append('Foo', 'Bar')) // => FoorBar | |
| log(string.append('Foo', string.id)) // => Foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment