This library provides commonly accepted basic predicates for list manipulation in the Prolog community. Some additional list manipulations are built-in. Their description is in section 4.29.
?- flatten([a, [b, [c, d], e]], X). X = [a, b, c, d, e] |
?- list_to_set([a,b,a], X) X = [a,b] |