Guest User

Untitled

a guest
Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. let hd (x::xs) = x
  2. let tl (x::xs) = xs
  3.  
  4. let rec delete x ls1 = match ls1 with
  5. | [] -> []
  6. | x1::tl -> if x1 = x then delete x tl else x1::(delete x tl)
  7. | x1::[] -> if x1 = x then delete x [] else [x1]
  8.  
  9. delete 7 [7;8;23;7;9;2]
Add Comment
Please, Sign In to add comment