Add List.physically_equal
Signed-off-by: Etienne Millon <me@emillon.org>
This commit is contained in:
parent
c6d5faa79f
commit
8306f261e7
|
@ -533,7 +533,7 @@ module Dep_stack = struct
|
||||||
let to_required_by t ~stop_at =
|
let to_required_by t ~stop_at =
|
||||||
let stop_at = stop_at.stack in
|
let stop_at = stop_at.stack in
|
||||||
let rec loop acc l =
|
let rec loop acc l =
|
||||||
if l == stop_at then
|
if List.physically_equal l stop_at then
|
||||||
List.rev acc
|
List.rev acc
|
||||||
else
|
else
|
||||||
match l with
|
match l with
|
||||||
|
|
|
@ -115,3 +115,5 @@ let rec nth t i =
|
||||||
| [], _ -> None
|
| [], _ -> None
|
||||||
| x :: _, 0 -> Some x
|
| x :: _, 0 -> Some x
|
||||||
| _ :: xs, i -> nth xs (i - 1)
|
| _ :: xs, i -> nth xs (i - 1)
|
||||||
|
|
||||||
|
let physically_equal = Pervasives.(==)
|
||||||
|
|
|
@ -43,3 +43,5 @@ val assoc : ('a * 'b) t -> 'a -> 'b option
|
||||||
val singleton : 'a -> 'a t
|
val singleton : 'a -> 'a t
|
||||||
|
|
||||||
val nth : 'a t -> int -> 'a option
|
val nth : 'a t -> int -> 'a option
|
||||||
|
|
||||||
|
val physically_equal : 'a t -> 'a t -> bool
|
||||||
|
|
Loading…
Reference in New Issue