Markus Mottl avatar Markus Mottl committed aa86f29

Use new List.iteri function in OCaml 4.00

Comments (0)

Files changed (9)

 Maintainers:      Markus Mottl <markus.mottl@gmail.com>
 LicenseFile:      COPYING.txt
 License:          GPL-3+
-OCamlVersion:     >= 3.12
+OCamlVersion:     >= 4.00
 FindlibVersion:   >= 1.3.1
 Homepage:         https://bitbucket.org/mmottl/aifad
 #Categories:
   let chisto = Array.make (Array.length target_attrs) 0 in
   let cvars = [| { tp = 1; samples = csamples; histo = chisto; } |] in
   let n_samples_1 = n_samples - 1 in
-  list_iteri
+  List.iteri
     (fun ix (sample, ccnstr) ->
       let sample_ix = n_samples_1 - ix in
       csamples.(sample_ix) <- FDAtom ccnstr;
       let chisto = Array.make (Array.length target_attrs) 0 in
       let cvars = [| { tp = 1; samples = csamples; histo = chisto; } |] in
 
-      list_iteri
+      List.iteri
         (fun ix (maybe_sample, ccnstr) ->
           let sample_ix = n_samples_1 - ix in
           csamples.(sample_ix) <- FDAtom ccnstr;
       let chisto = Array.make (Array.length target_attrs) 0 in
       let cvars = [| { tp = 1; samples = csamples; histo = chisto; } |] in
 
-      list_iteri
+      List.iteri
         (fun ix (sample, ccnstr) ->
           let sample_ix = n_samples_1 - ix in
           csamples.(sample_ix) <- FDAtom ccnstr;
           for i = 0 to cfdsums_lix do
             cvars.(i).(n_samples_1 - n) <- csmpl.(i)
           done in
-        list_iteri act smpl_lst;
+        List.iteri act smpl_lst;
         dvars, cvars in
   loop 0 []
 

src/ds2_entropy.ml

     let acti dst_ix src_ix =
       histos.(dst_ix) <- pre_histos.(src_ix);
       var_samples.(dst_ix) <- pre_var_samples.(src_ix) in
-    list_iteri acti !ixs_ref;
+    List.iteri acti !ixs_ref;
     let n_vars_1 = n_vars - 1 in
     let histo = histos.(n_vars_1) in
     let samples = var_samples.(n_vars_1) in
                   match tsub.(model_ix) with
                   | VarFree fdsum -> new_fdsums.(ix) <- fdsum
                   | VarStrct _ | Var -> assert false (* impossible *) in
-            list_iteri acti same;
+            List.iteri acti same;
             Val new_fdsums
         | Let (match_mod, var_mods) ->
             let new_var_mods = Array.make n_new_tpl Var in
             let acti ix = function
               | Left tpl_ix -> new_var_mods.(ix) <- var_mods.(tpl_ix)
               | Right tsub -> new_var_mods.(ix) <- tsub.(model_ix) in
-            list_iteri acti same;
+            List.iteri acti same;
             if array_forall is_var new_var_mods then MatchMod match_mod
             else Let (match_mod, new_var_mods)
         | MatchMod _ -> assert false (* impossible *) in

src/split_impl.ml

       let subs = Array.make (Array.length sub_tps) dummy_fdsum in
       let acti sub_ix (var_ix, subcnstr, sub_info) =
         subs.(sub_ix) <- calc_sum_mod vars.(var_ix).tp subcnstr sub_info in
-      list_iteri acti pos_infos;
+      List.iteri acti pos_infos;
       FDStrct (cnstr, subs)
 
 
                   new_sums.(new_tag) <- IStrct (map_prod_el cnv_tp pe)
               | IAtom -> ())
           | CProd, _ -> assert false in
-        list_iteri act_tag rhs_lst;
+        List.iteri act_tag rhs_lst;
         dispec.(new_nt) <- Sums new_sums in
   NTMap.iter act_nts gr_dom;
   {
 
 (* List functions *)
 
-let rec list_iteri_loop f i = function
-  | [] -> ()
-  | h :: t -> f i h; list_iteri_loop f (i + 1) t
-
-let list_iteri f lst = list_iteri_loop f 0 lst
-
 let rec list_fold_lefti_loop f ix acc = function
   | [] -> acc
   | h :: t -> list_fold_lefti_loop f (ix + 1) (f ix acc h) t
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)
 
-let version = "2.0.1"
+let version = "2.0.2"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.