Question: code in ML 2.2.9 Suppose ML did not have a cat operation. Imple- ment it yourself by writing a function cat that takes two lists

2.2.9 Suppose ML did not have a cat operation. Imple- ment it yourself by writing a function cat that takes two lists and returns their concatenation, using only cons. (Hint: Use pattern-matching only on one parameter, say, the first. What is cat([. xx)?) 1. (3 points) [DMFP] Exercise 2.2.9 (Implement the list append or list concatenation operator @ using only the cons :: operator.) - (op @); val it = fn ; 'a list * 'a list -> 'a list cat; val it = fn ; 'a list fn : 'a list * 'a list -> 'a list = Do not give more then 2 lines of code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
