columbia-0.1.0.2: Enhanced serialization for media that support seeking.

Safe HaskellTrustworthy
LanguageHaskell98

Data.Columbia.WithAddress

Synopsis

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.

Constructors

WithAddress Word32 t 
Address Word32 
Data t 

Instances

Functor WithAddress Source # 

Methods

fmap :: (a -> b) -> WithAddress a -> WithAddress b #

(<$) :: a -> WithAddress b -> WithAddress a #

(Sat (ctx Word32), Sat (ctx (WithAddress t)), Data ctx t) => Data ctx (WithAddress t) Source # 

Methods

gfoldl :: Proxy ctx -> (forall b c. Data ctx b => w (b -> c) -> b -> w c) -> (forall g. g -> w g) -> WithAddress t -> w (WithAddress t) #

gunfold :: Proxy ctx -> (forall b r. Data ctx b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WithAddress t) #

toConstr :: Proxy ctx -> WithAddress t -> Constr #

dataTypeOf :: Proxy ctx -> WithAddress t -> DataType #

dataCast1 :: Typeable1 t => Proxy ctx -> (forall b. Data ctx b => w (t b)) -> Maybe (w (WithAddress t)) #

dataCast2 :: Typeable2 t => Proxy ctx -> (forall b c. (Data ctx b, Data ctx c) => w (t b c)) -> Maybe (w (WithAddress t)) #

Read t => Read (WithAddress t) Source # 
Show t => Show (WithAddress t) Source # 
Typeable * t => RW (WithAddress t) Source # 
KeyComparable (WithAddress t) Source # 

nullAddress :: WithAddress t Source #

A null address object.

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 (unless you do something heroic with your own locking pattern).

newtype Fl m t Source #

Constructors

Fl 

Fields

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. The term structure of WithAddress constructor itself never ends up in the file.