Back to Search
Start Over
Type Inference of Simple Recursive Functions in Scala.
- Source :
- Acta Cybernetica; 2022, Vol. 25 Issue 4, p797-815, 19p
- Publication Year :
- 2022
-
Abstract
- Scala is a well-established multi-paradigm programming language known for its terseness that includes advanced type inference features. Unfortunately this type inferring algorithm does not support typing of recursive functions. This is both against the original design philosophies of Scala and puts an unnecessary burden on the programmer. In this paper we propose a method to compute the return types for simple recursive functions in Scala. We make a heuristic assumption on the return type based on the non-recursive execution branches and provide a proof of the correctness of this method. We implemented our method as an extension prototype in the Scala compiler and used it to successfully test our method on various examples. The algorithm does not have a significant effect on the compilation speed. The compiler extension prototype is available for further tests. [ABSTRACT FROM AUTHOR]
Details
- Language :
- English
- ISSN :
- 0324721X
- Volume :
- 25
- Issue :
- 4
- Database :
- Complementary Index
- Journal :
- Acta Cybernetica
- Publication Type :
- Academic Journal
- Accession number :
- 161543337
- Full Text :
- https://doi.org/10.14232/actacyb.282762