Question: Standard ML, tail recursion and equivalence. (a) Write a pure function rev that takes a list as a parameter (list of any type) and returns
Standard ML, tail recursion and equivalence.

(a) Write a pure function rev that takes a list as a parameter (list of any type) and returns a list with the same elements but in reverse order. Example: rev [1,2,3] returns [3,2,1) its parameter and return type should be polymorphic it should be tail recursive assume that is not tail recursive (i.e. do not use @), but :: is tail recursive (a) Write a pure function rev that takes a list as a parameter (list of any type) and returns a list with the same elements but in reverse order. Example: rev [1,2,3] returns [3,2,1) its parameter and return type should be polymorphic it should be tail recursive assume that is not tail recursive (i.e. do not use @), but :: is tail recursive
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
