let rec sumlist l = match l with | [] -> 0 | h::t -> h + (sumlist t);; let rec sumlist_tr_a l a = match l with | [] -> a | h::t -> sumlist_tr_a t (h + a);; let sumlist_tr l = let rec helper l a = match l with | [] -> a | h::t -> helper t (h + a) in helper l 0;; let rec makelist n = match n with | 0 -> [] | _ -> n::(makelist (n - 1));; let rec makelist_tr_a n a = match n with | 0 -> a | _ -> makelist_tr_a (n - 1) (n::a);; let makelist_tr n = let rec helper n a = match n with | 0 -> a | _ -> helper (n - 1) (n::a) in helper n [];;