Skip to content

Should we have a class for diffing? #52

@endgame

Description

@endgame

From a discussion with a colleague, the following class emerged:

-- | Law: applyAlways (diff x y) x = y
class Patch p => Diff p where
  -- | @diff from to@ returns a patch which turns @from@ into @to@.
  diff :: PatchTarget p -> PatchTarget p -> p

It seems useful, even if we cannot guarantee that such a class exists for every patch type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions