Hi, I am trying to make a function to pair up elements, and drop the last remaining element at the end. For example [1;2;3;4;5;6;7] would return [(1,2); (3,4); (5,6)]
So far I have:
let pair lst =
let rec pair’ lst lst2 =
match lst with
| [] → []
| x :: xs :: xss → pair’ xss (x,xs :: lst2) in
pair’ lst []