The AsSet command converts a list to a set and back to a list. In effect, it removes all extraneous elements.
gap> L:=[3,1]; [ 3, 1 ] gap> AsSet(L); [ 1, 3 ] gap> L; [ 3, 1 ] gap> Append(L,[1]); gap> L; [ 3, 1, 1 ] gap> AsSet(L); [ 1, 3 ]