Lazy functional programming in Java

  • Authors:
  • Anthony H. Dekker

  • Affiliations:
  • Defence Science and Technology Organisation, Canberra ACT

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 2006

Quantified Score

Hi-index 0.01

Visualization

Abstract

In this paper, we show how lazy functional programming techniques can be used within the Java programming language. We provide Java implementations of classic examples of lazy lists, such as the Sieve of Eratosthenes, the Eight Queens Problem, and natural-language parsing. We discuss how well these implementations succeed, compared to their original counterparts. We also point out the potential synergy between adding lazy techniques to Java, and adding generic types. The examples we provide would be suitable for teaching functional programming concepts in the context of a Java-based syllabus.