@hackage delta-types1.0.0.0
Delta types, also known as change actions.
Categories
License
Apache-2.0
Maintainer
hal@cardanofoundation.org
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
- 1.0.0.0 Thu, 27 Mar 2025
Installation
Tested Compilers
Dependencies (3)
- base >=4.14 && <5
- containers >=0.5 && <0.9
- semigroupoids >=6.0.1 && <6.1 Show all…
Dependents (1)
@hackage/delta-store
Package Flags
release
(off by default)
Enable optimization and `-Werror`
Overview
This package provides a notion of delta types via the Delta typeclass.
A delta type da for a base type a is a collection of values that each correspond to a change a → a of the base type. The following typeclass captures this correspondence:
class Delta da where
type Base da = a
apply :: da → (a → a)
In the literature, this concept is also known as a change action, with relations to incremental computation and differential lambda calculus. See References.
For example, one delta type for Set a is given by
data DeltaSet1 a = Insert a | Delete a
instance Delta (DeltaSet1 a) where
type Base (DeltaSet1 a) = Set a
apply (Insert a) = Data.Set.insert a
apply (Delete a) = Date.Set.delete a
In general, there may be multiple delta types associated with a single base type.
References
- Alvarez-Picallo, M., Eyers-Taylor, A., Peyton Jones, M., Ong, CH.L. (2019). Fixing Incremental Computation. In: Caires, L. (eds) Programming Languages and Systems. ESOP 2019. Lecture Notes in Computer Science(), vol 11423. Springer, Cham.
- M. Alvarez-Picallo, M. (2020). Change actions: from incremental computation to discrete derivatives. PhD thesis, Oxford.
- Apfelmus, H. (2023). Delta encodings help separate business logic from database operations. Bobkonf 2023, Berlin.