Type-Based Uncurrying for Unknown Function Calls

Research output: Contribution to conferencePaperResearchpeer-review

Abstract

In strict functional languages, a left-to-right evaluation of an application of a curried function to n arguments generally requires creating n - 1 intermediate closures and making n function calls. A type-based optimization can reduce the number of calls by consistently uncurrying function definitions and calls to them, and by inserting implicit currying coercions when functions receive too few arguments. However, it only uncurries calls to known (let-bound) functions. Naively uncurrying calls to unknown (λ -bound) functions generally fails, since the implicit uncurrying coercions do not preserve the semantics of programs with side effects. We propose a characterization of when calls to unknown (λ -bound) functions can be uncurried. We describe it as a type-based translation and outline an algorithm that implements the translation. We demonstrate that programs with side effect preserve their meaning across this translation, even when they require uncurrying coercions.

Original languageEnglish
Publication date2024
Number of pages12
DOIs
Publication statusPublished - 2024
Event35th Symposium on Implementation and Application of Functional Languages - Braga, Portugal
Duration: 29 Aug 202331 Aug 2023
Conference number: 35
https://ifl23.github.io/

Symposium

Symposium35th Symposium on Implementation and Application of Functional Languages
Number35
Country/TerritoryPortugal
CityBraga
Period29/08/202331/08/2023
OtherThe goal of IFL is to bring together researchers and developers actively engaged in the implementation and application of functional programming languages and function-oriented programming. You can find more information about the symposium on its oficial website.<br/><br/>The 35th Symposium on Implementation and Application of Functional Languages (IFL23) is held in Braga, Portugal and is a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional programming languages and function-oriented programming. See the call for papers in this page or in text format.
Internet address

Keywords

  • Currying
  • coercions
  • compiler optimization
  • separate compilation
  • side effects
  • type-directed translation
  • types
  • uncurrying

Cite this