Abstract
Pointers are known as mutable references in pure functional programming languages. In Haskell, IO-references and ST-references are the well-known monadic models of references. This paper propose a model of mutable references based on unique heaps. This model put less restriction on the evaluation order of basic reference operations. Moreover it has simpler, more tractable semantics and it supports features like shared references between heaps and virtual union of heaps.
The proposed model needs uniqueness typing. This need could be seen as a drawback but it can also be seen as a motivation for the spread of uniqueness typing in functional languages.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
The Clean compiler sources, http://clean.cs.ru.nl/Download/download.html
The Haskell Adaptive package, http://hackage.haskell.org/package/Adaptive
The Haskell ArrayRef package, http://hackage.haskell.org/package/ArrayRef
The Haskell base package, http://hackage.haskell.org/package/base
The Haskell stateref package, http://hackage.haskell.org/package/stateref
Barendsen, E., Smetsers, S.: Uniqueness typing for functional languages with graph rewriting semantics. Mathematical Structures in Computer Science 6(6), 579–612 (1996)
de Vries, E., Plasmeijer, R., Abrahamson, D.M.: Uniqueness typing simplified. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 201–218. Springer, Heidelberg (2008)
Fluet, M., Morrisett, G.: Monadic regions. SIGPLAN Not. 39(9), 103–114 (2004)
Jones, M.P.: Type classes with functional dependencies. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 230–244. Springer, Heidelberg (2000)
Jones, S.P.: Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in haskell
Launchbury, J., Jones, S.L.P.: Lazy functional state threads. SIGPLAN Not. 29(6), 24–35 (1994)
Lippmeier, B.: Type inference and optimisation for an impure world. PhD thesis, Australian National University (2009)
Läufer, K., Odersky, M.: Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems 16 (1994)
Jones, S.P., et al.: The Haskell 98 language and libraries: The revised report. Journal of Functional Programming 13(1),0-255 (2003), http://www.haskell.org/definition/
Jones, S.P., Hughes, J., et al.: Report on the Programming Language Haskell 98, A Non-strict, Purely Functional Language (February 1999)
Plasmeijer, R., Achten, P., Koopman, P.: itasks: executable specifications of interactive work flow systems for the web. SIGPLAN Not. 42, 141–152 (2007)
Plasmeijer, R., van Eekelen, M.: Concurrent Clean Version 2.0 Language Report (2001)
Schrijvers, T., Jones, S.P., Chakravarty, M., Sulzmann, M.: Type checking with open type functions. In: ICFP 2008: Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, , pp. 51–62. ACM, New York (2008)
Swierstra, W., Altenkirch, T.: Beauty in the beast: A functional semantics for the awkward squad. In:Haskell 2007: Proceedings of the ACM SIGPLAN workshop on Haskell workshop, pp. 25–36. ACM, New York (2007)
Wadler, P.: How to declare an imperative. ACM Comput. Surv. 29(3), 240–263 (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Diviánszky, P. (2010). Non-monadic Models of Mutable References. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds) Central European Functional Programming School. CEFP 2009. Lecture Notes in Computer Science, vol 6299. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-17685-2_5
Download citation
DOI: https://doi.org/10.1007/978-3-642-17685-2_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-17684-5
Online ISBN: 978-3-642-17685-2
eBook Packages: Computer ScienceComputer Science (R0)