Skip to content

Add an option to force elements together #3

@mbramson

Description

@mbramson

Add an option which forces the result to group certain elements together. If its not possible to group the specified elements together, the :impossible atom should be returned.

An example of the general gist:

iex> group([1,2,3,4], %{minimum: 1, maximum: 3, required: [{1, [3, 4]}]})
[[1, 3, 4], [2]]

iex> group([1, 2, 3, 4], %{minimum: 2, maximum: 2, required: [{1, [2, 3]}]})
:impossible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions