Values belonging to lazy data types have the advantage that sub-components can be accessed without evaluating the values as a whole: unneeded components remain unevaluated. A disadvantage is that often a large amount of space and time is required to handle lazy data types properly. Many special constructor cells are needed to ' glue' the individual parts of a composite object together and to store it in the heap. We present a way of representing data in functional languages which makes these special constructor cells superfluous. In some cases, no heap at all is needed to store this data. To make this possible, we introduce a new kind of data type: (partially) strict non-recursive data types. The main advantage of these types is that an efficient call-by-value mechanism can be used to pass arguments. A restrictive subclass of (partially) strict non-recursive data types, partially strict tuples, is treated more comprehensively. We also give examples of important classes of applications. In particular, we show how partially strict tuples can be used to define very efficient input and output primitives. Measurements of applications written in Concurrent Clean which exploit partially strict tuples have shown that speedups of 2 to 3 times are reasonable. Moreover, much less heap space is required when partially strict tuples are used.
[1]
Marinus J. Plasmeijer,et al.
High Level Specification of I/O in Functional Languages
,
1992,
Functional Programming.
[2]
Marinus J. Plasmeijer,et al.
The Concurrent CLEAN System, functional programming on the Macintosh
,
1991
.
[3]
Simon L. Peyton Jones,et al.
The spineless tagless G-machine
,
1989,
FPCA.
[4]
John Launchbury,et al.
Unboxed values as first class citizens
,
1991
.
[5]
Marko C. J. D. van Eekelen,et al.
Concurrent Clean
,
1991,
PARLE.
[6]
Philip Wadler,et al.
Projections for strictness analysis
,
1987,
FPCA.
[7]
Marinus J. Plasmeijer,et al.
Generating Efficient Code for Lazy Functional Languages
,
1991,
FPCA.
[8]
Simon L. Peyton Jones,et al.
Unboxed Values as First Class Citizens in a Non-Strict Functional Language
,
1991,
FPCA.
[9]
J. Tukey,et al.
An algorithm for the machine calculation of complex Fourier series
,
1965
.
[10]
Geoffrey L. Burn,et al.
Evaluation transformers - a model for the parallel evaluation of functional languages (extended abstract)
,
1987,
FPCA.
[11]
D. A. Turner,et al.
Miranda: A Non-Strict Functional language with Polymorphic Types
,
1985,
FPCA.