benchmarks.wiki / Public workspace

MMLU / Function signatures describe the types of the arguments to a function as well as…

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

Function signatures describe the types of the arguments to a function as well as the return value of the function. For instance, the addition function on reals has a signature of
add : real x real -> real
since it takes two real numbers and returns a real number. But, for a language that allows functions as return values, addition could be considered to have the signature
add : real -> (real -> real)
which means that add takes a single real (the first operand) and returns a new function that itself takes a single real (the second operand) and returns a real (the result). This process of reducing a function with multiple arguments to a function with fewer arguments is called currying. Which of the following is correct?

choices

  1. Currying can be applied to any function to the point where it has exactly one input argument.
  2. Currying cannot be applied to functions of more than two arguments.
  3. Currying cannot be applied to functions that return functions as arguments.
  4. Currying cannot be applied w functions that haw arguments that are functions.

subject

college_computer_science

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import