I can't remember what the practical was asking for now... If it's asking the functions to return something other than 'a list then I'm in trouble. Here's my code:
(* Q2 *)
- fun butlast [x] = []
| butlast ([y,x]) = [y]
| butlast (x::rest) = butlast(rest);
(* Q3 *)
- fun nth (x::rest,0) = []
| nth (x::rest, 1) = [x]
| nth (x::rest, n) = nth(rest, n-1);
Alaric is not answering why my previous code takes in 'a list list and returns 'a list. So, guys (Willa, Wombat, Squishy) please feel free to destroy my half destoryed ego.