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

1 Expert Approved Answer
Step: 1 Unlock

Certainly Heres a function appendfr that achieves the described behavior using forward recur... 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 Programming Questions!