Hy! Is there Any module in elixir which helps us in performing set operations?

- find Subset
- Find superset
- Find powerset etc

Hy! Is there Any module in elixir which helps us in performing set operations?

- find Subset
- Find superset
- Find powerset etc

There is the `MapSet`

module.

The `MapSet.subset?/2`

function can help you with the first 2 bulletpoints, though Iām not quite sure what a powerset is.

2 Likes

I explored mapset but didnāt find powerset implementation.

I wrote a code for powerset in elixir and I want to contribute how can I contribute will you please help me out

As we are currently explaining in the slack to you, proposals that extend the standard library have to happen in the Core mailinglist.

Though due the ācost of maintananceā, it probably isnāt a proposal that would be accepted into the standard library and instead it would be better to create a library for your implementation and publish it on hex.

1 Like

What would a function that generates a power set of a given set be useful for? The size of the output grows very rapidly, and checking "is this set `X`

in `P(S)`

" is easier to implement by checking that every element of `X`

is in `S`

.

thanks for the awesome information.

I thought thatās a fun exercise so I wrote a module for that:

3 Likes