Commit a2b698d7 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2006-05-11 12:28:00 by afrisch] Empty log message

Original author: afrisch
Date: 2006-05-11 12:28:00+00:00
parent 49f314ad
......@@ -33,10 +33,16 @@ let map_elements f t =
aux [] (get_len t - 2)
(* TODO: check that the comparison function is necessarily called
on a pair of equal elements if such a pair exist.
I guess any sort algorithm must do that! *)
exception DuplicateKey
let sort a =
(fun (i,_) (j,_) ->
assert (i != j); if (i:int) < j then (-1) else 1) a
if (i == j) then raise DuplicateKey;
if (i:int) < j then (-1) else 1) a
let real_create a =
let n = Array.length a in
(** Compact maps from integers to values. **)
exception DuplicateKey
type 'a t
val empty: 'a t
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment