Abstract
Data serialisation is a crucial feature of real-world programming languages, often provided by standard libraries or even built-in to the language. However, a number of questions arise when the language in question uses demand-driven evaluation and supports higher-order functions, as is the case for the lazy functional language Haskell. To date, solutions to serialisation for Haskell generally do not support higher-order functions and introduce additional strictness.
This paper investigates a novel approach to serialisation of Haskell data structures with a high degree of flexibility, based on runtime support for parallel Haskell on distributed memory platforms. This serialisation has highly desirable and so-far unrivalled properties: it is truly orthogonal to evaluation and also does not require any type class mechanisms. Especially, (almost) any kind of value can be serialised, including functions and IO actions. We outline the runtime support on which our serialisation is based, and present an API of Haskell functions and types which ensure dynamic type safety of the serialisation process. Furthermore, we explore and exemplify potential application areas for orthogonal serialisation.
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
Augustsson, L.: Personal communication, about a possible Haskell serialisation feature, during the Haskell Symposium (September 2009)
Berthold, J.: Explicit and implicit parallel functional programming: Concepts and implementation. Ph.D. thesis, Philipps-Universität Marburg, Germany (June 2008), http://archiv.ub.uni-marburg.de/diss/z2008/0547/
Berthold, J., Loidl, H.W., Al Zain, A.: Scheduling Light-Weight Parallelism in ArTCoP. In: Hudak, P., Warren, D. (eds.) PADL 2008. LNCS, vol. 4902, pp. 214–229. Springer, Heidelberg (2008)
Berthold, J., Loogen, R.: Parallel Coordination Made Explicit in a Functional Setting. In: Horváth, Z., Zsók, V., Butterfield, A. (eds.) IFL 2006. LNCS, vol. 4449, pp. 73–90. Springer, Heidelberg (2007)
Claessen, K.: Memoisation module based on Haskell generics, http://www.cse.chalmers.se/~ms/TR0912/Memo.hs (accessed 2010-03-15)
Corona, A.: Refserialize-0.2.7: Write to and read from Strings maintaining internal memory references. Haskell Library on Hackage, http://hackage.haskell.org/package/RefSerialize (accessed 2010-10-21)
Davie, T., Hammond, K., Quintela, J.: Efficient Persistent Haskell. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1998 – Draft Proceedings, London, UK (September 1998)
Elliott, C.: Memo trie library. Haskell Library on Hackage, http://hackage.haskell.org/package/MemoTrie (accessed 2010-10-20)
Marlow, S.: Haskell 2010 Language Report (June 2010), http://www.haskell.org/
Haskell Hierarchical Libraries: Base library, version 4.2.0.2. Haskell Library on Hackage, http://hackage.haskell.org/package/base (accessed 2010-10-21)
Haskell Wiki. Wiki, http://www.haskell.org/haskellwiki/ (accessed 2010-10-20)
Haskell Café: Discussion on “bulk synchronous parallel”, http://www.haskell.org/pipermail/haskell-cafe/2010-April/076593.html (accessed 2010-07-20)
Haskell Café: Discussion on “how to serialize thunks?”, http://www.haskell.org/pipermail/haskell-cafe/2006-December/020786.html (accessed 2010-07-23)
Haskell Café: Discussion “persist and retrieve of IO type?”, http://www.haskell.org/pipermail/haskell-cafe/2010-April/076121.html (accessed 2010-07-20)
Hinze, R.: Memo functions, polytypically! In: Jeuring, J. (ed.) Proc. of 2nd Workshop on Generic Programming, WGP 2000, Ponte de Lima, Portugal, pp. 17–32 (July 2000); Tech. Report UU-CS-2000-19, Utrecht Universiteit
Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. ACM SIGPLAN Notices 38(3), 26–37 (2003)
Loogen, R., Ortega-Mallén, Y., Peña-Marí, R.: Parallel Functional Programming in Eden. Journal of Functional Programming 15(3), 431–475 (2005)
McNally, D.J.: Models for Persistence in Lazy Functional Programming. Ph.D. thesis, University of St.Andrews (1993)
McNally, D.J., Davie, A.J.T.: Two models for integrating persistence and lazy functional languages. ACM SIGPLAN Notices 26(5), 43–52 (1991)
Michie, D.: ‘Memo’ functions and machine learning. Nature 218, 19–22 (1968)
Palmer, L.: Memo combinator library (data-memocombinators). Haskell Library on Hackage, http://hackage.haskell.org/package/data-memocombinators (accessed 2010-10-20)
Peyton Jones, S.: Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell (2002), http://research.microsoft.com/~simonpj/
Plasmeier, R.J., Koopman, P.: Personal communication (September 2010), about the Clean Dynamics implementation in practical use and its pragmatic limitations, during IFL (2010)
Quintela, J.J., Sánchez, J.J.: Persistent Haskell. In: Moreno-Díaz, R., Buchberger, B., Freire, J.L. (eds.) EUROCAST 2001. LNCS, vol. 2178, pp. 657–667. Springer, Heidelberg (2001); presented earlier, at IFL 1998, as [7]
Santos, A., Abdon Monteiro, B.: A Persistence Library for Haskell. In: Musicante, M.A., Haeusler, E.H. (eds.) Proceedings of SBLP 2001 - V Simpósio Brasileiro de Linguagens de Programação, Curitiba (May 2001)
Trinder, P., Hammond, K., Mattson Jr., J., Partridge, A., Peyton Jones, S.: GUM: a Portable Parallel Implementation of Haskell. In: PLDI 1996, pp. 78–88. ACM Press, Philadephia (1996)
Vervoort, M., Plasmeijer, R.J.: Lazy Dynamic Input/Output in the Lazy Functional Language Clean. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 101–117. Springer, Heidelberg (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Berthold, J. (2011). Orthogonal Serialisation for Haskell. In: Hage, J., Morazán, M.T. (eds) Implementation and Application of Functional Languages. IFL 2010. Lecture Notes in Computer Science, vol 6647. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24276-2_3
Download citation
DOI: https://doi.org/10.1007/978-3-642-24276-2_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-24275-5
Online ISBN: 978-3-642-24276-2
eBook Packages: Computer ScienceComputer Science (R0)