Skip to content

Commit ba43db7

Browse files
committed
Clarify order on uniq/uniq_by, closes #14304
1 parent c2c331d commit ba43db7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/elixir/lib/enum.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3841,6 +3841,9 @@ defmodule Enum do
38413841
@doc """
38423842
Enumerates the `enumerable`, removing all duplicate elements.
38433843
3844+
The first occurrence of each element is kept and all following
3845+
duplicates are removed. The overall order is preserved.
3846+
38443847
## Examples
38453848
38463849
iex> Enum.uniq([1, 2, 3, 3, 2, 1])
@@ -3866,7 +3869,8 @@ defmodule Enum do
38663869
considered duplicates if the return value of `fun` is equal for
38673870
both of them.
38683871
3869-
The first occurrence of each element is kept.
3872+
The first occurrence of each element is kept and all following
3873+
duplicates are removed. The overall order is preserved.
38703874
38713875
## Example
38723876

0 commit comments

Comments
 (0)