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

Add map_reduce #118

Open
jasone opened this issue Aug 28, 2021 · 1 comment
Open

Add map_reduce #118

jasone opened this issue Aug 28, 2021 · 1 comment

Comments

@jasone
Copy link
Contributor

jasone commented Aug 28, 2021

map and reduce compose, but if separate functions they communicate via a composite data structure that would require compiler heroics to see through. Since these operations are commonly used together, provide a map_reduce function for all container types which implement map and reduce.

@jasone
Copy link
Contributor Author

jasone commented Aug 28, 2021

The API should probably look like

val map_reduce 'a 'b >m >r: map:(a >m-> b) -> reduce:(b -> b >r-> b) -> t a >{m|r}-> option b
val map_reduce_hlt 'a 'b >m >r: map:(a >m-> b) -> reduce:(b -> b >r-> b) -> t a >{m|r}-> b

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

No branches or pull requests

1 participant