Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fumieval/incremental

Type class for patch and diff
https://github.com/fumieval/incremental

diff haskell

Last synced: 2 months ago
JSON representation

Type class for patch and diff

Awesome Lists containing this project

README

        

# incremental: incremental update interface

[![Hackage](https://img.shields.io/hackage/v/incremental.svg)](https://hackage.haskell.org/package/incremental)
![Haskell CI](https://github.com/fumieval/incremental/workflows/Haskell%20CI/badge.svg)
[![Discord](https://img.shields.io/discord/664807830116892674?color=%237095ec&label=Discord&style=plastic)](https://discord.gg/DG93Tgs)

This package provides a typeclass for incremental updates and diffing.

```haskell
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)
```