I found excellent documentation on the problem but, I admit, I totally fail in getting a grasp on how the solutions presented in the post worked.
Given a list of integers, I would like to perform operations on adjacent elements if they match a certain criteria. For example, how can I sum the adjacent elements that are equals, so that for
let x = [1;1;2;2;2;2;3;3;4;3;3;3]
f x
I got
[2; 8; 6; 4; 9]
?