Question: Write a function append_fr : 'a list -> 'a list -> 'a list that returns a list containing the elements in the first list at
Write a function append_fr : 'a list -> 'a list -> 'a list that returns a list containing the elements in the first list at the front of the second, with the order of the two lists preserved. Your function is required to use (only) forward recursion (no other form of recursion). You may not use any library functions, or @. # let rec append_fr list1 list1 = ...;; val append_fr : 'a list -> 'a list -> 'a list = # append_fr [1;3] [2;4];; - : int list = [1; 3; 2; 4]
Step by Step Solution
3.52 Rating (159 Votes )
There are 3 Steps involved in it
Certainly Heres a function appendfr that achieves the described behavior using forward recur... View full answer
Get step-by-step solutions from verified subject matter experts
