Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created January 25, 2012 12:51
Show Gist options
  • Select an option

  • Save machisuji/1676118 to your computer and use it in GitHub Desktop.

Select an option

Save machisuji/1676118 to your computer and use it in GitHub Desktop.
scala> def translate(coord: (Int, Int), str: String) = (coord._1 + 1, coord._2 - 1) -> str
translate: (coord: (Int, Int), str: String)((Int, Int), String)
scala> (1, 1) -> "test" :: Nil map translate
<console>:9: error: type mismatch;
found : ((Int, Int), String) => ((Int, Int), String)
required: ((Int, Int), java.lang.String) => ?
(1, 1) -> "test" :: Nil map translate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment