Skip to content

Instantly share code, notes, and snippets.

@globulon
Created March 31, 2012 17:49
Show Gist options
  • Select an option

  • Save globulon/2267095 to your computer and use it in GitHub Desktop.

Select an option

Save globulon/2267095 to your computer and use it in GitHub Desktop.
Monoids
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