Skip to content

Instantly share code, notes, and snippets.

@jrwest
Created February 9, 2012 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrwest/1784050 to your computer and use it in GitHub Desktop.
Save jrwest/1784050 to your computer and use it in GitHub Desktop.
def updateCondition(toyBox: ToyBox, name: String, newCondition: ToyCondition): ToyBox = {
toyBox.toys.get(name)
.map(t => toys.mod(toyBox, _ + (name -> condition.set(t, newCondition)))
.getOrElse(toyBox)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment