let rec assoc x = function | (h, a) :: t when h == x -> a | _ :: t -> assoc x t | [] -> raise Not_found