ML finger excercises. May/may not be graded. So do it anyway. :-) __________________________________________________________________ 1. Reading up on Chapters 1, 2, 3 and 4 of "ML for the Working Programmer", if you can get hold of the book, would not be a bad idea. 2. Define a function called explist sum of type real list -> real which returns the sum of the exponentials of the elements in the argument list. (use the Math module .. you can either open Math or use it directly Eg: Math.sin) eg. explist [0.0, 1.0, 2.0] = 11.107 3. Write a function map2 that applies a function to all elements in all element lists in a list of lists. eg. map2 (fn x => x*x) [[1,3,4], [4,3], [2]] = [[1,9,16], [16,9], [4]] 4. What are the types assigned to.. fn x => x fn ( _ , ( x , _ ) ) => x fn ( x , y ) => ( y , x ) 5. Arithmetic using Lists. A. Numerals can be expressed as lists of integers. For example decimal numbers can be expressed as lists of integers from 0 to 9. Write a function dec2bin: int list -> int list which converts decimal numbers expressed in this form to binary numbers in similar form. eg. dec2bin [2,9] = [1,1,1,0,1] B. Write bin2dec, the inverse of the dec2bin. eg. bin2dec [1,1,1,0,1] = [2,9] C. Maybe then you can try writing a function radconvert : int -> int -> string list -> string list (curried with 3 arguments) the first argument being radix1, second argument radix2 and the third argument is the list representation of a numeral in radix1. The function should return the list representation of the numeral in radix2. eg. radconvert 16 10 ["A", "3"] = ["1", "6", "3"] radconvert 4 5 ["2", "3", "1"] = ["1", "4", "0"] .. ok that should get you started and craving for more...