Safe Haskell | Trustworthy |
---|---|
Language | Haskell98 |
- data WithAddress t
- copoint :: WithAddress t -> t
- point :: t -> WithAddress t
- addressOf :: WithAddress t -> Word32
- dataOf :: WithAddress t -> t
- withAddresses :: forall ctx m d. (Data ctx d, Monad m) => PolyTraversal ctx m d
- writeBackAddresses :: forall ctx m d. (Data ctx d, Monad m) => PolyTraversalW ctx m d
Documentation
data WithAddress t Source #
Data type for a piece of data that may or may not have an explicit address associated with it. This is nice because I can play with these in pure code to manipulate data, while still remembering all of the explicit term structure.
Eq t => Eq (WithAddress t) Source # | |
Ord t => Ord (WithAddress t) Source # | |
Show t => Show (WithAddress t) Source # | |
copoint :: WithAddress t -> t Source #
point :: t -> WithAddress t Source #
addressOf :: WithAddress t -> Word32 Source #
dataOf :: WithAddress t -> t Source #
withAddresses :: forall ctx m d. (Data ctx d, Monad m) => PolyTraversal ctx m d Source #
The strategy reads term structure from a file and associates file addresses with it. Bear in mind that the addresses become no good at the moment your reader lock is relinquished, due to GC'ing.
writeBackAddresses :: forall ctx m d. (Data ctx d, Monad m) => PolyTraversalW ctx m d Source #
A strategy to intelligently reconstruct shared structure on disk. It intercepts any subterm with
type WithAddress
and that associates an address to the data, and writes that address
in lieu of writing all of the data, thereby achieving structural sharing. Note that the term
structure of WithAddress
constructor is skipped and does not get written.
Orphan instances
(Sat (ctx Word32), Sat (ctx (WithAddress t)), Data ctx t) => Data ctx (WithAddress t) Source # | |
KeyComparable (WithAddress t) Source # | |
Typeable * t => RW (WithAddress t) Source # | |