Question: 4. (i) Write directly by recursion a function sum_some : int option list -> int that computes the sum of all of the integers in

 4. (i) Write directly by recursion a function sum_some : int

4. (i) Write directly by recursion a function sum_some : int option list -> int that computes the sum of all of the integers in the list. (ii) Write the same function using only fold by filling in the ... in let sum_some2 xs List.fold (fun so -> match o with .) Oxs (iii) Write the same function using map and fold by filling in the ... in let sum_some3 xs = let f o = List.fold (+) 0 (List.map f xs) 4. (i) Write directly by recursion a function sum_some : int option list -> int that computes the sum of all of the integers in the list. (ii) Write the same function using only fold by filling in the ... in let sum_some2 xs List.fold (fun so -> match o with .) Oxs (iii) Write the same function using map and fold by filling in the ... in let sum_some3 xs = let f o = List.fold (+) 0 (List.map f xs)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!