Created
March 31, 2012 17:49
-
-
Save globulon/2267095 to your computer and use it in GitHub Desktop.
Monoids
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
| trait SemiGroup[T] { | |
| def add(x: T, y: T): T | |
| } | |
| trait Monoid[T] extends SemiGroup[T] { | |
| def unit: T | |
| } | |
| trait MonoidC[L[X]] { | |
| def add[T](k: L[T], l: L[T]): L[T] | |
| def apply[T](value: T): L[T] | |
| def unit[T]: L[T] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment