Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.21 KB | None | 0 0
  1. let rec drop_value l to_drop =
  2.   match l with
  3.   | [] -> []
  4.   | hd :: tl ->
  5.       if hd = to_drop
  6.       then drop_value tl to_drop
  7.       else hd :: drop_value tl to_drop
  8. ;;
  9.  
  10. drop_value [1;2;3;4;5;6;1] 1;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement