Skip to content

Instantly share code, notes, and snippets.

@halcat0x15a
Created June 7, 2013 09:13
Show Gist options
  • Save halcat0x15a/5728051 to your computer and use it in GitHub Desktop.
Save halcat0x15a/5728051 to your computer and use it in GitHub Desktop.
import scalaz._, Scalaz._
object MaxValue extends App {
val a = Map(1 -> 10, 2 -> 5)
val b = Map(2 -> 10, 3 -> 7)
val c = a.mapValues(Tags.MaxVal) |+| b.mapValues(Tags.MaxVal)
(c: Map[Int, Int]) assert_=== Map(1 -> 10, 2 -> 10, 3 -> 7)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment