Internal functions; typically unneeded by users.
One common case is defining certain Incremental instances. Sometimes
instead of deriving an Incremental instance you want to always send new data
if it has changed. This is easily supported with the
DPrim type and
import Data.Increments.Internal instance Incremental Foo where type Increment Foo = DPrim Foo changes = iprimDiff applyChanges = iprimApply
This is especially useful with large types that do not change often, when attempting to calculate the difference may be very expensive.
- class Incremental a where
- class Changed a where
- type IncrementalCnstr a = (Incremental a, Changed (Increment a))
- data DPrim a
- iprimDiff :: Eq a => a -> a -> DPrim a
- iprimApply :: a -> DPrim a -> a
Calculate differences between data structures.
generate the changes between the
Apply a changes to a value
Determine if a Increment representation contains a real change. Unchanging changes may be omitted.
A useful type constraint synonym for writing instances