Drop While
Implement the function
val drop_while : ('a -> bool) -> 'a list -> 'a list
so that drop_while f l is the result of removing the longest
prefix from l whose elements satisfy the predicate f.
Examples
let _ = assert (drop_while (fun x -> x <= 3) [1;2;3;4;5;4;3;2;1] = [4;5;4;3;2;1]) let _ = assert (drop_while (fun x -> x) [true;true;false;true] = [false;true]) let _ = assert (drop_while (fun _ -> true) [1;2;3;4;5] = []) let _ = assert (drop_while (fun _ -> false) [1;2;3;4;5] = [1;2;3;4;5])