package simple-diff

All checked builds pass
  1. Overview
  2. Docs
Simple_diff is a pure OCaml diffing algorithm.

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.3.tar.gz
sha256=f6d659f869aaaca2bfdbca0c07acced66b4ab5d19a0a1597754fb5c5d7fc8eb8
md5=4751d72fe03c4b3cc45ad6476bcbe558

Description

This diffing algorithm is a port of https://github.com/paulgb/simplediff with some minor differences in the implementation.

Tags

algorithms

Added to opam-repository:

README

Simple Diff

Description

Simple Diff is a pure OCaml implementation of a diffing algorithm ported from https://github.com/paulgb/simplediff.

Usage

opam install simple-diff

Below is some example usage in top/utop:

let old_lines = [| "I"; "really"; "like"; "icecream" |]
let new_lines = [| "I"; "do"; "not"; "like"; "icecream" |]

module Diff = Simple_diff.Make(String);;
open Diff;;

get_diff old_lines new_lines;;

#=> [
  Equal [| "I" |];
  Deleted [| "really" |];
  Added [| "do"; "not" |];
  Equal [| "like"; "icecream" |]
]

As displayed above, Simple Diff exposes a Simple_diff.Make functor which accepts a module that implements the Simple_diff.Comparable interface (check out the docs for the interface). This makes Simple_diff.S.get_diff work with lists of elements of whatever you type you want (as long as interface is followed).

Dependencies (5)

  1. re >= "1.7.1"
  2. ocamlbuild build
  3. ocamlfind build
  4. topkg build
  5. ocaml >= "4.00.0"

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building simple-diff with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.3 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure