Created
June 7, 2013 09:13
-
-
Save halcat0x15a/5728051 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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