sequencing data structures

Johan Jeuring
Wed, 20 Aug 2003 14:55:09 +0200

> I want to sequence data structures in an efficient manner, to store 
> them
> to files and to send them over the network.
> Simply deriving Show and Read is not very good, because it's space
> inefficient and read cannot give any output until the whole data
> structure is parsed.
> So I thought I should store them in some space efficient format.
> First problem: how to make them derivable (so that I don't have to 
> write
> boilerplate class instances for all my data structures).
> I read the "derivable type classes" paper, but it's not implemented in
> ghc (only Unit and :+: and :*: are, which is not enough).
> So how to go about it? Using DrIFT? Template Haskell?

[Shameless plug]:

This is typically the kind of thing Generic Haskell was designed for:

For more information you can also consult your local Generic
Programming expert Patrik Jansson.

-- Johan Jeuring