package ocaml-unikraft-arm64

  1. Overview
  2. Docs
OCaml cross compiler to the freestanding Unikraft arm64 backends

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.2.0.tar.gz
sha256=ca18a45ef86791d5ffa18436945fbec850b6f3dd68a6a62753b4cb1b6999b19a

doc/compiler-libs.common/Diffing_with_keys/index.html

Module Diffing_with_keys

When diffing lists where each element has a distinct key, we can refine the diffing patch by introducing two composite edit moves: swaps and moves.

Swaps exchange the position of two elements. Swap cost is set to 2 * change - epsilon. Moves change the position of one element. Move cost is set to delete + addition - epsilon.

When the cost delete + addition is greater than change and with those specific weights, the optimal patch with Swaps and Moves can be computed directly and cheaply from the original optimal patch.

type 'a with_pos = {
  1. pos : int;
  2. data : 'a;
}
val with_pos : 'a list -> 'a with_pos list
type ('l, 'r, 'diff) mismatch =
  1. | Name of {
    1. pos : int;
    2. got : string;
    3. expected : string;
    4. types_match : bool;
    }
  2. | Type of {
    1. pos : int;
    2. got : 'l;
    3. expected : 'r;
    4. reason : 'diff;
    }
type ('l, 'r, 'diff) change =
  1. | Change of ('l, 'r, 'diff) mismatch
  2. | Swap of {
    1. pos : int * int;
    2. first : string;
    3. last : string;
    }
  3. | Move of {
    1. name : string;
    2. got : int;
    3. expected : int;
    }
  4. | Insert of {
    1. pos : int;
    2. insert : 'r;
    }
  5. | Delete of {
    1. pos : int;
    2. delete : 'l;
    }

This specialized version of changes introduces two composite changes: Move and Swap

val prefix : ('l, 'r, 'diff) change Format_doc.printer
module Define (D : Diffing.Defs with type eq := unit) : sig ... end