Question: use ocaml pleaseand remember cannot use pattern matching! Simply using fold left! Thanks! Higher Order Functions- In the following section, you have access to the

"Higher Order Functions- In the following section, you have access to the fold_left standard library function with the following signature. - fold_left : ('a -> b => a) => 'a -> 'b list -> 'a You may not use pattern matching or calls to other library functions. If a function has been declared in a previous problem, you may call it in future problems even if you have not worked out its exact solution. 7. Construct a function with the follow signature, e combinations : 'a list -> b list -> (a * 'b) list liste Such that when given two lists of lengths m and n respectively, [ al; a2; a3; [ bl; b2; b3; ; am 1: bn ]: la liste b list It computes a nested list of all combinations of their elements pair together. They should be ordered as shown below. [ [ (al, bi); (al, b2); (al, b3); [ (a2, b1); (a 2, 52); (a2, b3); [ (a3, 11); (a 3, b2); (a3, b3); - ; (al, bn) ); ; (a2, bn) ); ; (a3, bn) 1; . [ (am, b1); (am, b2); (am, b3); ..; (am, bn) ) )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
