projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restored bottom up run
[SXSI/xpathcomp.git]
/
hlist.ml
diff --git
a/hlist.ml
b/hlist.ml
index
cd3c90d
..
4b83668
100644
(file)
--- a/
hlist.ml
+++ b/
hlist.ml
@@
-16,6
+16,7
@@
module type S = sig
val iter : (elt -> 'a) -> t -> unit
val rev : t -> t
val rev_map : (elt -> elt) -> t -> t
val iter : (elt -> 'a) -> t -> unit
val rev : t -> t
val rev_map : (elt -> elt) -> t -> t
+ val length : t -> int
end
module Make ( H : Hcons.S ) : S with type elt = H.t =
end
module Make ( H : Hcons.S ) : S with type elt = H.t =
@@
-78,5
+79,5
@@
struct
let rev l = fold cons l nil
let rev_map f l = fold (fun x acc -> cons (f x) acc) l nil
let rev l = fold cons l nil
let rev_map f l = fold (fun x acc -> cons (f x) acc) l nil
-
+ let length l = fold (fun _ c -> c+1) l 0
end
end