Abstract
We present a typed calculus IL (“intermediate language”) which supports the embedding of ML-like (strict, eager) and Haskell-like (non-strict, lazy) languages, without favoring either. IL’s type system includes negation (continuations), but not implication (function arrow). Within IL we find that lifted sums and products can be represented as the double negation of their unlifted counterparts. We exhibit a compilation function from IL to AM—an abstract von Neumann machine—which maps values of ordinary and doubly negated types to heap structures resembling those found in practical implementations of languages in the ML and Haskell families. Finally, we show that a small variation in the design of AM allows us to treat any ML value as a Haskell value at runtime without cost, and project a Haskell value onto an ML type with only the cost of a Haskell deepSeq. This suggests that IL and AM may be useful as a compilation and execution model for a new language which combines the best features of strict and non-strict functional programming.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Appel, A.W.: Compiling With Continuations. Cambridge University Press, Cambridge (1992)
Curien, P.-L., Herbelin, H.: The duality of computation. In: Proc. ICFP (2000), http://pauillac.inria.fr/~herbelin/habilitation/icfp-CurHer00-duality+errata.ps
Griffin, T.G.: A formulae-as-types notion of control. In: Proc. POPL 1990 (1990)
Jones, S.P.: Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine. Journal of Functional Programming 2(2), 127–202 (1992)
Jones, S.P., Launchbury, J., Shields, M., Tolmach, A.: Bridging the gulf: a common intermediate language for ML and Haskell. In: Proc. POPL (1998), http://www.cartesianclosed.com/pub/intermediate_language/neutral.ps
Plotkin, G.D.: Call-by-name, call-by-value and the λ-calculus. Theoretical Computer Science 1, 125–159 (1975), http://homepages.inf.ed.ac.uk/gdp/publications/cbn_cbv_lambda.pdf
Rudiak-Gould, B.: The NotNotML project website, http://www.cl.cam.ac.uk/~br276/notnotML/
van Bakel, S., Lengrand, S., Lescanne, P.: The language X: circuits, computations and Classical Logic. In: Proc. ICTCS (2005), http://www.doc.ic.ac.uk/~svb/Research/Abstracts/vBLL.html
Wadler, P.: Call-by-value is dual to call-by-name. In: Proc. ICFP 2003, pp. 189–201 (2003), http://homepages.inf.ed.ac.uk/wadler/papers/dual/dual.pdf
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Rudiak-Gould, B., Mycroft, A., Jones, S.P. (2006). Haskell Is Not Not ML. In: Sestoft, P. (eds) Programming Languages and Systems. ESOP 2006. Lecture Notes in Computer Science, vol 3924. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11693024_4
Download citation
DOI: https://doi.org/10.1007/11693024_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33095-0
Online ISBN: 978-3-540-33096-7
eBook Packages: Computer ScienceComputer Science (R0)