:: Ord a => [a] -> [a] package:containers

<math>. The nubOrd function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. By using a Set internally it has better asymptotics than the standard nub function.


nubOrd is strict in the elements of the list.

Efficiency note

When applicable, it is almost always better to use nubInt or nubIntOn instead of this function. For example, the best way to nub a list of characters is
nubIntOn fromEnum xs