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 language | English |
---|---|
Publication date | 2024 |
Number of pages | 12 |
DOIs | |
Publication status | Published - 2024 |
Event | 35th Symposium on Implementation and Application of Functional Languages - Braga, Portugal Duration: 29 Aug 2023 → 31 Aug 2023 Conference number: 35 https://ifl23.github.io/ |
Symposium
Symposium | 35th Symposium on Implementation and Application of Functional Languages |
---|---|
Number | 35 |
Country/Territory | Portugal |
City | Braga |
Period | 29/08/2023 → 31/08/2023 |
Other | The 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