(* CMSC 330 / Fall 2009 / Project 3 *) (* NAME: *) (* Implement the following functions *) (*---------------------------------------------------------- function prod l : int list -> int returns the product of the elements of l. should return 1 if the list is empty. *) let rec prod l = 0 ;; (*---------------------------------------------------------- function add_tail l e : 'a list -> 'a -> 'a list takes a list l and a single element e returns a new list where e is appended to the back of l. For example, addTail [1;2] 3 = [1;2;3]. *) let rec add_tail l e = 0 ;; (*---------------------------------------------------------- function index l e : 'a list -> 'a -> int takes a list and a single element returns the position of the last occurrence of that element in the list (indexed by zero). should return -1 if the element is not in the list. *) let rec index l e = 0 ;; (*---------------------------------------------------------- function unzip l : ('a*'b) list -> ('a list)*('b list) given a list of pairs returns a pair of lists with the elements in the same order. For example, unzip [(1, 2); (3, 4)] = ([1; 3], [2;4]). *) let rec unzip l = 0 ;; (*---------------------------------------------------------- function app_int f m n : (int->'a)->int->int->'a list returns the list [f m; f (m+1); ...; f n]. should return the empty list if n < m. *) let rec app_int f m n = 0 ;;