Coder Social home page Coder Social logo

Comments (2)

thsutton avatar thsutton commented on June 2, 2024

The changeValue on Del is present (now) for the sake of computing the change metric used to minimise patches during construction. I should have defined a datatype to represent patches independently from the internal data structure.

In the near future I'll be making a major release which changes aeson-diff to use the RFC 6902 JSON Patch format. JSON Patch does not include a value on the remove operation but instead has a separate test operation which, used together, allows a similar semantics to the traditional behaviour you were expecting.

from aeson-diff.

thsutton avatar thsutton commented on June 2, 2024

@srijs I've just merged a branch preparing for a 1.0 release. This replaces the original ad hoc operations and patch format with the operations and JSON encoding defined in RFC 6902.

The Rem operation still has the non-operational Value (I may change this before cutting a release) but the semantics you want can now be implemented as described in the RFC using a Tst immediately succeeded by a Rem operation :

-- | Delete a 
del :: Pointer -> Value -> Patch
del p v = Patch [ Tst p v, Rem p v ]

from aeson-diff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.