package legacy_diffable

  1. Overview
  2. Docs

Source file legacy_diffable_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
open Core

module type S_plain = sig
  type t

  module Update : sig
    module Diff : sig
      type t [@@deriving sexp_of]
    end

    type t = Diff.t list [@@deriving sexp_of]
  end

  val update : t -> Update.t -> t
  val diffs : from:t -> to_:t -> Update.t

  (* This function should never return an empty list. *)
  val to_diffs : t -> Update.t
  val of_diffs : Update.t -> t
end

module type S1_plain = sig
  type 'a t

  module Update : sig
    module Diff : sig
      type 'a t [@@deriving sexp_of]
    end

    type 'a t = 'a Diff.t list [@@deriving sexp_of]
  end

  val update : 'a t -> 'a Update.t -> 'a t
  val diffs : ('a -> 'a -> int) -> from:'a t -> to_:'a t -> 'a Update.t

  (* This function should never return an empty list *)
  val to_diffs : 'a t -> 'a Update.t
  val of_diffs : 'a Update.t -> 'a t
end

module type S = sig
  module Update : sig
    module Diff : sig
      type t [@@deriving bin_io, sexp]
    end

    type t = Diff.t list [@@deriving bin_io, sexp]
  end

  include S_plain with module Update := Update
end

module type S1 = sig
  module Update : sig
    module Diff : sig
      type 'a t [@@deriving bin_io, sexp]
    end

    type 'a t = 'a Diff.t list [@@deriving bin_io, sexp]
  end

  include S1_plain with module Update := Update
end
OCaml

Innovation. Community. Security.