Work In Progress

Work on this post is underway... It will be done "soon..."


  • A SemiGroup is a type class with a single operation append.
  • If we throw away the right side of the SemiGroup, we get a first SemiGroup and if we through away the left side we get a second SemiGroup
  • Don’t think of SemiGroup as a summation/addition (regardless of append)
  • A good example ofa SemiGroup is a string, int, option…
  • Law: Must be associative (but not necessarily commutative, string is not commutative, yet it is associative)
trait SemiGroup[A] {
  def append(l: => A, r: => A): A // Note: lazy parameters
}

Resources

  1. Functional Scala by John A. De Goes (Toronto Edition)
  2. Scalaz SemiGroup