Skip to content

Instantly share code, notes, and snippets.

@softprops
Created April 21, 2014 17:54
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 softprops/11150610 to your computer and use it in GitHub Desktop.
Save softprops/11150610 to your computer and use it in GitHub Desktop.
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_51).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def curryme(beep: Int)(boop: String*) = beep * boop.size
curryme: (beep: Int)(boop: String*)Int
scala> val c = curryme(1)_
c: Seq[String] => Int = <function1>
scala> c("boom")
<console>:10: error: type mismatch;
found : String("boom")
required: Seq[String]
c("boom")
@softprops
Copy link
Author

because anon functions don't support varargs

scala> val f: (String* => Int) = _.size
<console>:1: error: ')' expected but '=>' found.
       val f: (String* => Int) = _.size

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