Bohtvaroh

Blogger - Scalaz Motivation - 3

Jun 1st, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.17 KB | None | 0 0
  1. trait Monoid[A] {
  2.   def mzero: A
  3.   def mappend(a1: A, a2: A): A
  4. }
  5.  
  6. object IntMonoid extends Monoid[Int] {
  7.   def mzero = 0
  8.   def mappend(a: Int, b: Int) = a + b
  9. }
Advertisement
Add Comment
Please, Sign In to add comment