simple-diff

Simple_diff is a pure OCaml diffing algorithm.
README

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).

Install
Published
08 Feb 2017
Sources
v0.3.tar.gz
md5=4751d72fe03c4b3cc45ad6476bcbe558
Dependencies
re
>= "1.7.1"
topkg
build
ocaml
>= "4.00.0"
Reverse Dependencies