Skip to content

Instantly share code, notes, and snippets.

@PavelGnatyuk
Created November 22, 2020 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PavelGnatyuk/400ee03f4492dedf74b3bbe537aad229 to your computer and use it in GitHub Desktop.
Save PavelGnatyuk/400ee03f4492dedf74b3bbe537aad229 to your computer and use it in GitHub Desktop.
String extension for Monoid
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