Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - seantanly/elixir-combination: A simple combinatorics library providing combination and permutation.

A simple combinatorics library providing combination and permutation. - seantanly/elixir-combination

Visit SiteGitHub - seantanly/elixir-combination: A simple combinatorics library providing combination and permutation.

GitHub - seantanly/elixir-combination: A simple combinatorics library providing combination and permutation.

A simple combinatorics library providing combination and permutation. - seantanly/elixir-combination

Powered by 0x5a.live ๐Ÿ’—

Combination

Build Status Hex.pm Version

Elixir library to generate combinations and permutations from Enumerable.

See Examples.

Documentation

API documentation is available at http://hexdocs.pm/combination

Adding Combination To Your Project

To use Combination with your projects, edit your mix.exs file and add it as a dependency:

defp deps do
  [
    {:combination, "~> x.x.x"},
  ]
end

Examples

To generate combinations,


iex> 1..3 |> Combination.combine(2)
[[3, 2], [3, 1], [2, 1]]

To generate permutations,


iex> 1..3 |> Combination.permutate
[[1, 2, 3], [2, 1, 3], [3, 1, 2], [1, 3, 2], [2, 3, 1], [3, 2, 1]]

iex> 1..3 |> Combination.permutate(fn p -> Enum.at(p, 0) == 1 end)
[[1, 2, 3], [1, 3, 2]]

LICENSE

This software is licensed under MIT License.

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.