Skip to content

Instantly share code, notes, and snippets.

@raboof
Created April 24, 2015 11:59
Show Gist options
  • Save raboof/58071b9014557e03370e to your computer and use it in GitHub Desktop.
Save raboof/58071b9014557e03370e to your computer and use it in GitHub Desktop.
mapValue
implicit class PimpMyMap[A,B](map: Map[A,B]) {
def mapValue(a: A, f: B =>B) = map.map {
case (`a`, b) => (a, f(b))
case other => other
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment