package patience_diff

  1. Overview
  2. Docs

In diff terms, a hunk is a unit of consecutive ranges with some Same context before and after New, Old, and Replace ranges. Each hunk contains information about the original arrays, specifically the starting indexes and the number of elements in both arrays to which the hunk refers.

Furthermore, a diff is essentially a list of hunks. The simplest case is a diff with infinite context, consisting of exactly one hunk.

type 'a t = {
  1. mine_start : int;
  2. mine_size : int;
  3. other_start : int;
  4. other_size : int;
  5. ranges : 'a Range.t list;
}
include sig ... end
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
val all_same : 'a t -> bool

all_same t returns true if t contains only Same ranges.

OCaml

Innovation. Community. Security.