Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:28:04+00:00 2026-06-12T03:28:04+00:00

Suppose I have a function of 2 parameters that I need to apply partially,

  • 0

Suppose I have a function of 2 parameters that I need to apply partially, I need to define it as:

def f(a: Int)(b: Int) = { /* some code */ }

And then I can apply it partially as def fWithA = f(a) _

My question is: In order to curry a function why does Scala require that the parameters are declared using multiple parameter lists? It would be preferable to be able to curry any function as desired.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:28:05+00:00Added an answer on June 12, 2026 at 3:28 am

    A few reasons ‘real’ currying requires multiple parameter lists in Scala:

    • overloading. Unlike purely functional languages, in Scala you can overload methods. If you partially apply a function, the compiler may not be able to distinguish which overload you mean. The specification limits overloading resolution to the first parameter list.

    • error messages. “not enough arguments for method call” is a very useful (and easy to understand) error message. If one allowed currying for any method, the error message would be “required: but “some function type with many arrows” type.

    • performance. Running on the JVM makes it very efficient to call methods, while functions (going through an interface call) are slower.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a function/method F() that takes 3 parameters $A, $B and $C
Suppose I have some kind of factory function which creates objects that are largely
As a toy example, suppose that we have a function called 'my_func' (the code
Suppose I have a function like this (I use akka 2.0.2): def foo(message: String):
Suppose I have a function void myFun(int*) In C++ what exactly does the following
Suppose I have a function which can either take an iterable/iterator or a non-iterable
suppose I have a function: function test(){} test.prototype.method01=function(){ //do something } test.prototype.method02=function(){ //how can
Suppose I have a function that returns a closure: sub generator { my $resource
I need to have a command handler for a ToggleButton that can take multiple
I understand that functions can have attributes. So I can do the following: def

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.