Created
November 22, 2020 07:20
-
-
Save PavelGnatyuk/400ee03f4492dedf74b3bbe537aad229 to your computer and use it in GitHub Desktop.
String extension for Monoid
This file contains 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
extension String: Monoid { | |
static var neutral: String = "" | |
func operation(_ other: String) -> String { | |
self + other | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment