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

dict.each #580

Closed
aslilac opened this issue May 8, 2024 · 3 comments
Closed

dict.each #580

aslilac opened this issue May 8, 2024 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aslilac
Copy link
Contributor

aslilac commented May 8, 2024

Would be helpful to have a function for iterating over a Dict to do IO, much like list.each. |> dict.to_list() |> list.each(...) works, but the unnecessary conversion is a bit unintuitive/distracting.

It'd also let you bind the key and value more naturally:

|> dict.each(fn (a_key_value, a_value_value) { ... })

vs.

|> dict.to_list()
|> list.each(fn (kv) {
  let #(a_key_value, a_value_value) = kv
  ...
})
@lpil
Copy link
Member

lpil commented May 8, 2024

Sounds good!

@lpil lpil added good first issue Good for newcomers help wanted Extra attention is needed labels May 8, 2024
@giacomocavalieri
Copy link
Member

I think this can be closed now

@lpil
Copy link
Member

lpil commented May 21, 2024

Thank you

@lpil lpil closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants