Skip to content

Instantly share code, notes, and snippets.

@jawher
Created January 14, 2012 23:01
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 jawher/1613274 to your computer and use it in GitHub Desktop.
Save jawher/1613274 to your computer and use it in GitHub Desktop.
Really Scala ? Really ?
[info] Compiling 20 Scala sources to /Users/jawher/Dropbox/coding/moulder-s/target/scala-2.9.1/classes...
[error] /Users/jawher/Dropbox/coding/moulder-s/src/main/scala/moulder/moulds/Repeater.scala:19: type mismatch;
[error] found : (A, Int) => List[org.jsoup.nodes.Node]
[error] required: (A, Int) => scala.collection.GenTraversableOnce[org.jsoup.nodes.Node]
[error] data.zip(0 until data.length).flatMap[Node, List[Node]]((item: A, index: Int) => {
[error] ^
[info] Compiling 20 Scala sources to /Users/jawher/Dropbox/coding/moulder-s/target/scala-2.9.1/classes...
[error] /Users/jawher/Dropbox/coding/moulder-s/src/main/scala/moulder/moulds/Repeater.scala:19: type mismatch;
[error] found : (A, Int) => List[org.jsoup.nodes.Node]
[error] required: (A, Int) => scala.collection.GenTraversableOnce[?]
[error] data.zip(0 until data.length).flatMap((item: A, index: Int) => {
[error] ^
@lpereir4
Copy link

scala> val f: Function1[Tuple2[Int, Int], List[Int]] = (a,b) => 1::Nil
<console>:7: error: wrong number of parameters; expected = 1
       val f: Function1[Tuple2[Int, Int], List[Int]] = (a,b) => 1::Nil
                                                             ^

Limits of syntactic sugar : 2-ary function or 1-ary function taking a tuple ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment