Logo

Programming-Idioms

History of Idiom 118 > diff from v15 to v16

Edit summary for version 16 by programming-idioms.org:
[Elixir] List name is x. Also, we still have to define y.

Version 15

2016-10-28, 02:28:31

Version 16

2016-10-29, 13:31:17

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration
Code
["a", "b", "c", "b"] |> Enum.uniq |> List.to_tuple
Code
x |> Enum.uniq |> List.to_tuple
Comments bubble
Remove list duplication and convert to a tuple that has no ordering.
Comments bubble
Remove list duplication and convert to a tuple that has no ordering.