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.


Runtime System Orthogonal Serialisation Type Check Type Safety Runtime Support 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Augustsson, L.: Personal communication, about a possible Haskell serialisation feature, during the Haskell Symposium (September 2009)Google Scholar
  2. 2.
    Berthold, J.: Explicit and implicit parallel functional programming: Concepts and implementation. Ph.D. thesis, Philipps-Universität Marburg, Germany (June 2008),
  3. 3.
    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)CrossRefGoogle Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    Claessen, K.: Memoisation module based on Haskell generics, (accessed 2010-03-15)
  6. 6.
    Corona, A.: Refserialize-0.2.7: Write to and read from Strings maintaining internal memory references. Haskell Library on Hackage, (accessed 2010-10-21)
  7. 7.
    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)Google Scholar
  8. 8.
    Elliott, C.: Memo trie library. Haskell Library on Hackage, (accessed 2010-10-20)
  9. 9.
    Marlow, S.: Haskell 2010 Language Report (June 2010),
  10. 10.
    Haskell Hierarchical Libraries: Base library, version Haskell Library on Hackage, (accessed 2010-10-21)
  11. 11.
    Haskell Wiki. Wiki, (accessed 2010-10-20)
  12. 12.
    Haskell Café: Discussion on “bulk synchronous parallel”, (accessed 2010-07-20)
  13. 13.
    Haskell Café: Discussion on “how to serialize thunks?”, (accessed 2010-07-23)
  14. 14.
    Haskell Café: Discussion “persist and retrieve of IO type?”, (accessed 2010-07-20)
  15. 15.
    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 UniversiteitGoogle Scholar
  16. 16.
    Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. ACM SIGPLAN Notices 38(3), 26–37 (2003)CrossRefGoogle Scholar
  17. 17.
    Loogen, R., Ortega-Mallén, Y., Peña-Marí, R.: Parallel Functional Programming in Eden. Journal of Functional Programming 15(3), 431–475 (2005)CrossRefzbMATHGoogle Scholar
  18. 18.
    McNally, D.J.: Models for Persistence in Lazy Functional Programming. Ph.D. thesis, University of St.Andrews (1993)Google Scholar
  19. 19.
    McNally, D.J., Davie, A.J.T.: Two models for integrating persistence and lazy functional languages. ACM SIGPLAN Notices 26(5), 43–52 (1991)CrossRefGoogle Scholar
  20. 20.
    Michie, D.: ‘Memo’ functions and machine learning. Nature 218, 19–22 (1968)CrossRefGoogle Scholar
  21. 21.
    Palmer, L.: Memo combinator library (data-memocombinators). Haskell Library on Hackage, (accessed 2010-10-20)
  22. 22.
    Peyton Jones, S.: Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell (2002),
  23. 23.
    Plasmeier, R.J., Koopman, P.: Personal communication (September 2010), about the Clean Dynamics implementation in practical use and its pragmatic limitations, during IFL (2010)Google Scholar
  24. 24.
    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]CrossRefGoogle Scholar
  25. 25.
    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)Google Scholar
  26. 26.
    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)Google Scholar
  27. 27.
    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)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Jost Berthold
    • 1
  1. 1.Department of Computer ScienceUniversity of CopenhagenDenmark

Personalised recommendations