Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 700 Bytes

README.md

File metadata and controls

17 lines (14 loc) · 700 Bytes

incremental: incremental update interface

Hackage Haskell CI Discord

This package provides a typeclass for incremental updates and diffing.

class Incremental a where
  -- | the difference type
  type Delta a
  -- | @'maybe' a ('patch' a) ('diff' b a) ≡ b@
  patch :: a -> Delta a -> a
  -- | returns 'Nothing' when there is no update
  diff :: a -> a -> Maybe (Delta a)