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

All lens deletion bug #21

Closed
hissssst opened this issue Oct 21, 2022 · 1 comment
Closed

All lens deletion bug #21

hissssst opened this issue Oct 21, 2022 · 1 comment

Comments

@hissssst
Copy link
Owner

As @ffloyd mentioned in #20, I see some weird behavior with all/0 lens:

import Pathex

data = [
  %{ "a" => 1 },
  %{ "a" => 2 }
]

all_a = Pathex.Lenses.all() ~> path("a")

Pathex.get(data, all_a) |> IO.inspect(label: "get")
Pathex.delete!(data, all_a) |> IO.inspect(label: "delete!")

And as result get/2 works, but delete/2 fails:

** (Pathex.Error) 
  Couldn't find element

    Path:      all() ~> path("a")

    Structure: [%{"a" => 1}, %{"a" => 2}]

    (stdlib 3.17.2) erl_eval.erl:685: :erl_eval.do_apply/6
    (stdlib 3.17.2) erl_eval.erl:893: :erl_eval.expr_list/6
    (stdlib 3.17.2) erl_eval.erl:408: :erl_eval.expr/5
    (elixir 1.14.0) lib/module/parallel_checker.ex:100: Module.ParallelChecker.verify/1
hissssst added a commit that referenced this issue Oct 25, 2022
All lens unrolling
All lens extra testing
CODE_OF_CONDUCT
.tool-versions removed
hissssst added a commit that referenced this issue Oct 25, 2022
All lens unrolling
All lens extra testing
CODE_OF_CONDUCT
.tool-versions removed
@hissssst
Copy link
Owner Author

Fixed in v2.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant