-let iter_args f = function
- | P0 -> ()
- | P1 arg1 -> f arg1
- | P2 (arg1, arg2) -> f arg1; f arg2
- | P3 (arg1, arg2, arg3) -> f arg1; f arg2; f arg3
-
-let iteri_args f = function
- | P0 -> ()
- | P1 arg1 -> f 0 arg1
- | P2 (arg1, arg2) -> f 0 arg1; f 1 arg2
- | P3 (arg1, arg2, arg3) -> f 0 arg1; f 1 arg2; f 2 arg3
-
-let map_args f = function
- | P0 -> []
- | P1 arg1 -> [f arg1]
- | P2 (arg1, arg2) ->
- let n1 = f arg1 in let n2 = f arg2 in [n1; n2]
- | P3 (arg1, arg2, arg3) ->
- let n1 = f arg1 in let n2 = f arg2 in let n3 = f arg3 in [n1; n2; n3]
-
-let nr_args = function | P0 -> 0 | P1 _ -> 1 | P2 _ -> 2 | P3 _ -> 3
-