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

[Automation] Enumerable map enhancements #148

Conversation

nizam-supraoracles
Copy link

Copy link

@aregng aregng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
would it make sense to have filter_map option as well where it accepts 2 fucctions for filtering and then mapping the value and returns the vector of the mapped values.
this way for example automation_registry_state::get_active_task_ids can utilize this function.

@sjoshisupra
Copy link

Looks good. would it make sense to have filter_map option as well where it accepts 2 fucctions for filtering and then mapping the value and returns the vector of the mapped values. this way for example automation_registry_state::get_active_task_ids can utilize this function.

@nizam-supraoracles , I agree, this is a good suggestion. We can certainly have a map where a transformer function f: V -> T can be taken and it returns vector<T>. Try if we can also have a filter_map where it can take a predicate and a function. I am also not sure if two such lambda/closure are supported by Move. But if possible, we should have them.

@nizam-supraoracles nizam-supraoracles merged commit 94c8edf into feature/automation-networks Dec 27, 2024
1 of 2 checks passed
@nizam-supraoracles nizam-supraoracles deleted the feature/enumerable_map_enhancement branch December 27, 2024 14:17
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

Successfully merging this pull request may close these issues.

3 participants