Last active
March 7, 2018 13:47
-
-
Save kolov/86ca7a1bd81fd2b3cb8c3d6e9f1eb364 to your computer and use it in GitHub Desktop.
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
trait Semigroup[A] { | |
def combine(x: A, y: A): A | |
} | |
trait Monoid[A] extends Semigroup[A] { | |
def zero: A | |
} | |
// Laws: | |
//Associativity | |
append(a1, append(a2, a3)) == append(append(a1, a2), a3) | |
//Identity | |
append(a, zero) == a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment