Add List.physically_equal

Signed-off-by: Etienne Millon <me@emillon.org>
This commit is contained in:
Etienne Millon 2018-08-06 08:26:10 +00:00
parent c6d5faa79f
commit 8306f261e7
3 changed files with 5 additions and 1 deletions

View File

@ -533,7 +533,7 @@ module Dep_stack = struct
let to_required_by t ~stop_at =
let stop_at = stop_at.stack in
let rec loop acc l =
if l == stop_at then
if List.physically_equal l stop_at then
List.rev acc
else
match l with

View File

@ -115,3 +115,5 @@ let rec nth t i =
| [], _ -> None
| x :: _, 0 -> Some x
| _ :: xs, i -> nth xs (i - 1)
let physically_equal = Pervasives.(==)

View File

@ -43,3 +43,5 @@ val assoc : ('a * 'b) t -> 'a -> 'b option
val singleton : 'a -> 'a t
val nth : 'a t -> int -> 'a option
val physically_equal : 'a t -> 'a t -> bool