Question: The first 25 exercises should all have one-line solutions using map, foldr, or foldl. You can also use other predefined functions, of course, but do
The first 25 exercises should all have one-line solutions using map, foldr, or foldl. You can also use other predefined functions, of course, but do not write any additional name functions and do not use explicit recursion. If you need helper functions, use anonymous ones. for example, if the problem says "write a function add2 that takes an int list and returns the same list with 2 added to every element," you answer should be fun add2 x = map ( fn a = > a + 2 ) x;
Exercise 2 Write a fnction ordlist of type char list - > int list that takes a list of characters and returns the list of the integer codes of those characters. for example, if you evaulate ordlist [#"A", #"b", #"C"] you should get [ 65, 98, 67 ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
