Question: Write a function ap: ('a'b) list> 'a list -> 'b list ap fs args applies each function in fs to each argument in args
Write a function ap: ('a'b) list> 'a list -> 'b list ap fs args applies each function in fs to each argument in args in order. For example, ap [(fun x -> x^"?"); (fun x -> x^"!")] ["foo"; "bar"]= ["foo?"; "bar?" ; "foo!"; "bar!"] where is an OCaml operator for string concatenation. let ap fs args = (* YOUR CODE HERE *) assert (ap (fun x -> x^"?"); (fun x - x^!")] ["foo"; "bar"]= ["foo?"; "bar?"; "foo!"; "bar!"]);
Step by Step Solution
There are 3 Steps involved in it
Heres an OCaml function ap that takes a list of functions fs ... View full answer
Get step-by-step solutions from verified subject matter experts
