Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest expression changes that create better patterns #5

Open
zachallaun opened this issue Feb 22, 2023 · 0 comments
Open

Suggest expression changes that create better patterns #5

zachallaun opened this issue Feb 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@zachallaun
Copy link
Owner

zachallaun commented Feb 22, 2023

Mneme currently only produces patterns for the returned value, but there are situations where the value doesn’t produce a desired pattern. MapSet comes to mind. For example, this match pattern is invalid:

MapSet.new([1, 2, 3]) = MapSet.new([1, 2, 3])

# would have to be something like
%MapSet{} = MapSet.new()

These cases could be identified and simple transformations offered as suggestions. For example:

auto_assert some_set()

# could suggest
auto_assert [1, 2, 3] <- some_set() |> MapSet.to_list()
@zachallaun zachallaun added the enhancement New feature or request label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant