3 State_missing
| State_partial
| State_complete
| State_verified
5 let state_to_char = function
8 | State_complete
-> '
2'
9 | State_verified
-> '
3'
11 let char_to_state = function
12 | '
0'
-> State_missing
13 | '
1'
-> State_partial
14 | '
2'
-> State_complete
15 | '
3'
-> State_verified
18 let create n c
= Bytes.make n
(state_to_char c
)
19 let get x i
= char_to_state (Bytes.get x i
)
20 let set x i c
= Bytes.set x i
(state_to_char c
)
21 let length = Bytes.length
23 let s = Bytes.create n
in
28 let to_string x
= Bytes.to_string x
29 let of_string x
= Bytes.of_string x
32 let l = Bytes.length x
in
41 Array.init (length x
) (fun i
-> f i
(get x i
))
43 let fold_lefti f acc x
=
47 else aux (f acc i
(get x i
)) (i
+ 1) in
53 i
< l && (p i
(get x i
) || aux (i
+1)) in
59 i
>= l || p
(get s i
) && aux (i
+1) in