skip to main content
10.1145/1863495.1863500acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Generic storage in Haskell

Published:26 September 2010Publication History

ABSTRACT

We present a framework for constructing functional data structures that can be stored on disk. The data structures reside in a heap saved in a binary file. Operations read and write only the parts of the data structure that are actually needed. The framework is based on expressing datatypes as fixed points of functors and then annotating the recursive positions with additional information. We explain how functions, if expressed in terms of standard recursion patterns, can be easily lifted from a pure setting to an effectful, annotated scenario. As a running example, we sketch how to implement a persistent library of finite maps based on binary search trees.

Skip Supplemental Material Section

Supplemental Material

wgp-1110-loeh.mov

mov

190.3 MB

References

  1. }}R. Backhouse, P. Jansson, J. Jeuring, and L. Meertens. Generic programming: An introduction. In Advanced Functional Programming, pages 28--115, 1998.Google ScholarGoogle Scholar
  2. }}D. Barry and T. Stanienda. Solving the Java object storage problem. Computer, 31:33--40, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}R. Bird and L. Meertens. Nested datatypes. In Mathematics of Program Construction, pages 52--67. Springer, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}T.-R. Chuang and S.-C. Mu. Out-of-core functional programming with type-based primitives. In Practical Aspects of Declarative Languages, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}K. Claessen and D. Sands. Observable sharing for functional circuit description. In In Asian Computing Science Conference, pages 62--73. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}A. G. Corona. TCache: A transactional data cache with configurable persistence, 2009. hackageDB: TCache.Google ScholarGoogle Scholar
  7. }}M. Fokkinga. Monadic maps and folds for arbitrary datatypes. Technical report, Memoranda Informatica 94--28, University of Twente, 1994.Google ScholarGoogle Scholar
  8. }}J. Garrigue. Code reuse through polymorphic variants. In Workshop on Foundations of Software Engineering, 2000.Google ScholarGoogle Scholar
  9. }}N. Ghani and P. Johann. Initial algebra semantics is enough! In Typed Lambda Calculus and Applications, number 4583 in LNCS, pages 207--222, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}A. Gill. Type-safe observable sharing in Haskell. In ACM SIGPLAN Haskell Symposium, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}T. Harris, S. Marlow, S. Peyton-Jones, and M. Herlihy. Composable memory transactions. In Principles and Practice of Parallel Programming, pages 48--60. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}R. Hinze and R. Paterson. Finger trees: a simple general-purpose data structure. Journal of Functional Programming, 16(2):197--217, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}R. Hinze, J. Jeuring, and A. Löh. Type-indexed data types. In Mathematics of Program Construction, LNCS, pages 148--174. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}A. Jacobson. HAppS-State: Event-based distributed state, 2009. hackageDB: HAppS-State.Google ScholarGoogle Scholar
  15. }}P. Jansson and J. Jeuring. Polytypic data conversion programs. Science of Computer Programming, 43:2002, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}P. Jansson and J. Jeuring. PolyP - a polytypic programming language extension. In Principles of Programming Languages, pages 470--482. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}P. Johann. Foundations for structured programming with GADTs. In Principles of Programming Languages, pages 297--308, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}O. Kiselyov. iteratee: Iteratee-based I/O, 2009. hackageDB: iteratee.Google ScholarGoogle Scholar
  19. }}L. Kolmodin and D. Stewart. binary: Binary serialisation for Haskell values using lazy ByteStrings, 2009. hackageDB: binary.Google ScholarGoogle Scholar
  20. }}L. Meertens. Paramorphisms. Formal Aspects of Computing, 4(5): 413--424, September 1992.Google ScholarGoogle ScholarCross RefCross Ref
  21. }}E. Meijer, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Functional Programming Languages and Computer Architecture, pages 124--144. Springer, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}J. Nievergelt and E. M. Reingold. Binary search trees of bounded balance. In ACM symposium on Theory of computing, pages 137--142. ACM, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}A. Rodriguez Yakushev, S. Holdermans, A. Löh, and J. Jeuring. Generic programming with fixed points for mutually recursive datatypes. In International Conference on Functional Programming, pages 233--244. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}T. Sheard. Generic unification via two-level types and parameterized modules. In International Conference on Functional Programming, pages 86--97. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}S. Smetsers, A. van Weelden, and R. Plasmeijer. Efficient and typesafe generic data storage. In Workshop on Generative Technologies, Budapest, Hungary, April 5 2008. Electronic Notes in Theoretical Computer Science.Google ScholarGoogle Scholar
  26. }}W. Swierstra. Data types à la carte. Journal of Functional Programming, 18(4):423--436, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}T. Uustalu and V. Vene. Primitive (co)recursion and course-of-value (co)iteration, categorically. Informatica, 10:5--26, 1999.Google ScholarGoogle Scholar
  28. }}T. van Noort, A. Rodriguez, S. Holdermans, J. Jeuring, and B. Heeren. A lightweight approach to datatype-generic rewriting. In Workshop on Generic Programming, pages 13--24. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. }}M. van Steenbergen, J. P. Magalhães, and J. Jeuring. Generic selections of subexpressions. In Workshop on Generic Programming. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}V. Vene and T. Uustalu. Functional programming with apomorphisms (corecursion). In Nordic Workshop on Programming Theory, 1998.Google ScholarGoogle Scholar
  31. }}S. Visser. A generic approach to datatype persistency in Haskell. Master's thesis, Utrecht University, 2010. URL http://github.com/sebastiaanvisser/msc-thesis/downloads.Google ScholarGoogle Scholar

Index Terms

  1. Generic storage in Haskell

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      WGP '10: Proceedings of the 6th ACM SIGPLAN workshop on Generic programming
      September 2010
      116 pages
      ISBN:9781450302517
      DOI:10.1145/1863495

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 26 September 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate30of43submissions,70%

      Upcoming Conference

      ICFP '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader