Skip to content

Instantly share code, notes, and snippets.

package test
import collection.mutable.ListBuffer
/**
* @author Matt Hicks <mhicks@powerscala.org>
*/
trait Element
trait Parentable extends Element {
@nuttycom
nuttycom / BindSemigroup.scala
Created December 18, 2011 23:12 — forked from jdegoes/BindSemigroup.scala
BindSemigroup
implicit def BindSemigroup[M[_], A](implicit bind: Bind[M], s: Semigroup[A]): Semigroup[M[A]] = new Semigroup[M[A]] {
def append(v1: M[A], v2: => M[A]): M[A] = bind.bind(v1)((a: A) => v2.map(s.append(a, _)))
}