Question: in ocaml language Write a function ap: ('a -> 'b) list -> a list -> 'b list ap fs args applies each function in fs

in ocaml language

in ocaml language Write a function ap: ('a -> 'b) list ->

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 *)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the ap function in OCaml you can use Listmap to iterate over the f... View full answer

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!