Commit 01a9eb8f authored by Pietro Abate's avatar Pietro Abate

[r2005-02-21 17:32:57 by afrisch] New compilation for types -- does not detect...

[r2005-02-21 17:32:57 by afrisch] New compilation for types -- does not detect ill-formed recursion yet

Original author: afrisch
Date: 2005-02-21 17:32:57+00:00
parent 097b5407
......@@ -299,6 +299,13 @@ module Map = struct
| [],[] -> ()
| _ -> assert false
let rec may_collide f exn l1 l2 =
match (l1,l2) with
| (x1,y1)::l1, (x2,y2)::l2 when X.compare x1 x2 = 0 ->
f y1 y2; may_collide f exn l1 l2
| [], [] -> ()
| _ -> raise exn
let rec map f = function
| (x,y)::l -> (x, f y)::(map f l)
| [] -> []
......
......@@ -56,6 +56,7 @@ sig
val map_from_slist: (X.t -> 'a) -> t -> 'a map
val collide: ('a -> 'b -> unit) -> 'a map -> 'b map -> unit
val may_collide: ('a -> 'b -> unit) -> exn -> 'a map -> 'b map -> unit
val map: ('a -> 'b) -> 'a map -> 'b map
val mapi: (X.t -> 'a -> 'b) -> 'a map -> 'b map
val constant: 'a -> t -> 'a map
......
This diff is collapsed.
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