Efficient and Type-Safe Generic Data Storage

In this paper we present an elegant method for sequentializing arbitrary data using the generic language extension of the functional programming language Clean. We show how the proposed operations can be used to store values of any concrete data type in several kinds of IO containers (such as files or arrays of characters), and how to manipulate stored data efficiently. Moreover, by extending stored data with encoded type information, data manipulation will be type-safe. Defining these operations generically has the advantage that specific instances for user defined data types can be generated fully automatically. Compared to traditional sequentialization methods (or to common data manipulation, using relational data bases) our operations are an order of magnitude faster.

[1]  Sjaak Smetsers,et al.  Optimizing Generic Functions , 2004, MPC.

[2]  Bernard Robinet,et al.  Combinators and functional programming languages : Thirteenth Spring School of the LITP, Val d'Ajol, France, May 6-10, 1985, proceedings , 1986 .

[3]  Ralf Hinze,et al.  Generic Programs and Proofs , 2000 .

[4]  Marinus J. Plasmeijer,et al.  Lazy Dynamic Input/Output in the Lazy Functional Language Clean , 2002, IFL.

[5]  Marinus J. Plasmeijer,et al.  A Generic Programming Extension for Clean , 2001, IFL.

[6]  Ralf Hinze,et al.  A new approach to generic functional programming , 2000, POPL '00.

[7]  Xavier Leroy The objective caml system release 3 , 2001 .

[8]  Bernard Robinet,et al.  Combinators and Functional Programming Languages , 1986 .

[9]  Johan Jeuring,et al.  Polytypic data conversion programs , 2002, Sci. Comput. Program..

[10]  Marco Pil Dynamic Types and Type Dependent Functions , 1998, IFL.

[11]  X. Leroy The Objective Caml system release 3.09 Documentation and user''s manual , 2005 .

[12]  Marinus J. Plasmeijer,et al.  iTasks: executable specifications of interactive work flow systems for the web , 2007, ICFP '07.

[13]  Simon L. Peyton Jones,et al.  Scrap your boilerplate: a practical design pattern for generic programming , 2003, TLDI '03.

[14]  Johan Jeuring,et al.  PolyP—a polytypic programming language extension , 1997, POPL '97.

[15]  Ralf Lämmel,et al.  Scrap your boilerplate: a practical approach to generic programming , 2003 .