score:3
Accepted answer
def sigma(x:int, y:int, z:int, a:int)(f:(int,int,int,int) => double):double = 1.1
def bigpi(x: int, y: int, z: int, a: int)(
f: (int,int,int,int) => ((int,int,int,int) => double) => double
):double = 2.2
bigpi(1,2,3,4)(sigma)
the intellij ide says there are unnecessary parentheses but the compiler says otherwise.
score:1
try this:
def bigpi(x: int, y: int, z: int, a: int)(s: (int, int, int, int) => ((int, int, int, int) => double) => double) = whatever
Source: stackoverflow.com
Related Query
- How to use scala case class as function parameter to specify different fields to use?
- How to use fresh identifier in function parameter list in Scala macro
- How to use the function type in scala within defined in type meaningfully?
- Spark Scala How to use replace function in RDD
- How to use flink fold function in scala
- How do I solve this Scala function parameter type erasure error?
- How to use Array[String] in a function expecting String* in Scala
- How to understand and use scala macro, and write a more complex function
- Cannot use java value as parameter to java annotation on scala function
- How to use java8 lambda and function in scala
- How to use scala macros to create a function object (to create a Map[String, (T) => T])
- How to match type parameter of a function in Scala
- How to use a value as a parameter to target function
- How to initialize function type parameter in Scala class?
- How to call a function on an object with a generic type parameter using scala macros?
- How to call a Scala function with short parameter list?
- How to set type parameter bound in scala to make generic function for numerics?
- How to make parameter of a function more generic in Scala
- How to use zip and map to create zipwith function to Array in scala
- How to use type parameter for Scala implicit class?
- How can I use this Java function in Scala in a UDF?
- How to use scala bounds of type parameter to access a method
- scala : use of braces for a function when the parameter is a predicate
- How to stub function parameter using mockito in scala
- how to use filter function in scala
- How to convert scala function as parameter in c++?
- How to use explode function for arrays in scala
- Use function parameter as annotation argument in Scala 2.11.x: annotation argument needs to be a constant
- how use functional programming in scala function
- how to use 'mkString' function for this situation in Scala
More Query from same tag
- Scala and playframework shared cache between nodes
- How to retain accented characters when doing a 301 redirect
- Checking a Scala Promise for Success
- scala play Read json conditionally populate case class
- Scala Parser Combinator Replace Patterns
- How to mock a method with functional arguments in Scala?
- Create a subset of a Dataframe
- Spark toDF cannot resolve symbol after importing sqlContext implicits
- Exception:'Field "label” does not exist Spark
- Scala generics usage for methods + json4s parsing
- How to compile scala swing app?
- Spark ML: Data de-normalization
- Using Play's JSON autoformatting when json property names don't match
- Scala - making a WS http request
- Why does `.asInstanceOf` sometimes throw, and sometimes not?
- akka persistence dont work
- Using Slick with Kudu/Impala
- Why can't I run all Java JUnit Tests from Package Explorer? - Scala Plugin Issue
- Testing injected controllers in Play for Scala
- Access to WrappedArray elements
- Does anonymous function requires lambda format (println ex)?
- Write function with type parameter
- How to aggregate sum on multi columns on Dataframe using reduce function and not groupby?
- Scala – Make implicit value classes available in another scope
- Definition of Nil List in Scala
- When using type classes, how to deal with object in different ways?
- Scala - bad constant pool tag
- Return a specific type from for yield in Scala
- Akka Http Request and Response pattern
- Suggest a way to lift these functions