File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ type 'a t = 'a ref
2+
3+ let make x = ref x
4+ let get x = ! x
5+ let set atomic v = atomic := v
6+
7+ let fetch_and_add atomic n =
8+ let v = ! atomic in
9+ atomic := v + n;
10+ v
Original file line number Diff line number Diff line change 1- module List = Stdlib. ListLabels
1+ module List = struct
2+ let [@ warning " -32" ] rec equal ~eq l1 l2 = match l1, l2 with
3+ | [] , [] -> true
4+ | [] , _ ::_ | _ ::_ , [] -> false
5+ | x ::xs , y ::ys -> if eq x y then equal ~eq xs ys else false
6+
7+ let [@ warning " -32" ] rec compare ~cmp l1 l2 = match l1, l2 with
8+ | [] , [] -> 0
9+ | [] , _ ::_ -> - 1
10+ | _ ::_ , [] -> 1
11+ | x ::xs , y ::ys ->
12+ let r = cmp x y in
13+ if r = 0 then compare ~cmp xs ys else r
14+
15+ include Stdlib. ListLabels
16+ end
217
318module Poly = struct
419 let equal = ( = )
You can’t perform that action at this time.
0 commit comments