list – Prolog exercise: filter sequence of consecutive elements – Stack

I am getting mad of prolog. I have to do an exercise which is …. % untested delete_singles([], []). delete_singles([A|T], O) :- ( T = [A|T1] -> O = [A, A|O1],