prairie-0.0.4.0: A first class record field library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Prairie.Diff

Description

This module contains a utility for diffing two records.

Since: 0.0.1.0

Synopsis

Documentation

diffRecord Source #

Arguments

:: (Record rec, FieldDict Eq rec) 
=> rec

The old record.

-> rec

The new record.

-> [Update rec] 

Given two Records, this function produces a list of Updates that can be performed on the first record such that it will equal the second.

updateRecord (diffRecord old new) old == new

A [Update rec] can be serialized with ToJSON, sent over the wire, and parsed with FromJSON, so you can efficiently and easily represent patches to Records.

Since: 0.0.1.0