Java stream fusion: Adapting FP mechanisms for an OO setting

In this paper, we show how stream fusion, a program transformation technique used in functional programming, can be adapted for an Object-Oriented setting. This makes it possible to have more Stream operators than the ones currently provided by the Java Stream API. The addition of more operators all...

ver descrição completa

Detalhes bibliográficos
Autor principal: Ribeiro, Francisco (author)
Outros Autores: Saraiva, João (author), Pardo, Alberto (author)
Formato: conferencePaper
Idioma:eng
Publicado em: 2019
Assuntos:
Texto completo:http://hdl.handle.net/1822/68620
País:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/68620
Descrição
Resumo:In this paper, we show how stream fusion, a program transformation technique used in functional programming, can be adapted for an Object-Oriented setting. This makes it possible to have more Stream operators than the ones currently provided by the Java Stream API. The addition of more operators allows for a greater deal of expressiveness. To this extent, we show how these operators are incorporated in the stream setting. Furthermore, we also demonstrate how a specific set of optimizations eliminates overheads and produces equivalent code in the form of for loops. In this way, programmers are relieved from the burden of writing code in such a cumbersome style, thus allowing for a more declarative and intuitive programming approach.