I wrote this function which was supposed to give me the before last element of a list, but it doesn't work? Do you know why? thanks!
let rec exo1= match l with |List.length l = 0 or 1 -> failwith exo1 |List.length l > 2 -> List.tl l in exo1 l |List.length l = 2 -> List.hd l ;;