+let rec list_fold_right_cps g map l a =
+ match l with
+ | [] -> g a
+ | hd :: tl ->
+ let h a = map g hd a in
+ list_fold_right_cps h map tl a
+
+let rec list_fold_left_cps g map a = function
+ | [] -> g a
+ | hd :: tl ->
+ let h a = list_fold_left_cps g map a tl in
+ map h a hd
+