let rec indexof str lst index = match lst with cur::rest when cur = str -> index | _::rest -> indexof str rest (index+1) | [] -> raise Not_found