Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 5a49ee23 authored by POTTIER Francois's avatar POTTIER Francois

Simplify [Production.foldnt_lazy].

parent 5416475d
......@@ -785,17 +785,9 @@ module Production = struct
let k, k' = ntprods.(nt) in
Misc.mapij k k' f
(* This funny variant is lazy. If at some point [f] does not demand its
second argument, then iteration stops. *)
let foldnt_lazy (nt : Nonterminal.t) (f : index -> (unit -> 'a) -> 'a) (seed : 'a) : 'a =
let foldnt_lazy nt f accu =
let k, k' = ntprods.(nt) in
let rec loop prod seed =
if prod < k' then
f prod (fun () -> loop (prod + 1) seed)
else
seed
in
loop k seed
Misc.foldij_lazy k k' f accu
(* Accessors. *)
......
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