Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
given StringMonoid as Monoid[String]:
def unit: String = ""
extension (s: String) def combine(other: String): String = s + other
given IntMonoid as Monoid[Int]:
def unit: Int = 0
extension (i: Int) def combine(other: Int): Int = i + other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.