reify: Serialize data

[ data, library, program ] [ Propose Tags ]

This is a library for reifying Haskell data structures in GHC. Haskell values are mapped into representations that we call graphs (for want of a better name). The representations are encoded in the Haskell type Graph, which is just an ordinary algebraic data type. This will not reify functions.

Bitrotten.


[Skip to Readme]

Modules

[Last Documentation]

  • PrettyGraph
  • ReifyHs

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1
Dependencies base, ghc (==6.5) [details]
License LicenseRef-GPL
Author Bernie Pope <bjpop@csse.unimelb.edu.au>
Maintainer none
Category Data
Home page http://www.cs.mu.oz.au/~bjpop/code.html
Uploaded by GwernBranwen at 2009-01-19T22:40:00Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables reify
Downloads 2118 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2017-01-02 [all 7 reports]

Readme for reify-0.1.1

[back to package description]
This is a library for reifying Haskell data structures in GHC.

Haskell values are mapped into representations that we call
graphs (for want of a better name). The representations are
encoded in the Haskell type Graph, which is just an ordinary
algebraic data type.

The method for reification is:

   reify :: a -> IO Graph

Note that it can take _any_ value as its argument, there are
no constraints on that type.

The result is returned in the IO monad because the Graph 
that it returns depends on the state of evaluation of the 
underlying value. To do otherwise would not be pure.

The reification is conservative (or lazy). It will not cause any
further evaluation of the value being observed. So you can safely
apply reify to lazy data structures etc.

reify also detects cycles in the heap representation of a value.
The cycles are visible in the resulting Graph. If a value has
a finite heap representation, then reify will return a finite
Graph! Each node in the Graph structure is tagged with a unique
label that can be used to identify nodes and re-construct cycles.

reify does not observe other forms of sharing within a value 
(sharing that does not lead to cycles).

A method for pretty printing Graphs is provided by the module 
PrettyGraph.

Sadly, all functions are represented by the same Graph, and
are pretty printed just as "<Function>".

reify also knows a little bit about exceptions and other slightly
weird things inside GHC, but it is not yet exhaustive (GHC has many
heap object types).

Unfortunately, we need to turn on profiling in order to get GHC to
keep the names of data constructors around on the heap. This is
an ugly hack, and I hope that one day it can be avoided (perhaps
with some help from the compiler team).

If you make any modifications please contribute them back to me.
Thanks.

Bernie: bjpop@cs.mu.oz.au