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

Missing functions: foldr, reverse #26

Open
rohieb opened this issue Apr 28, 2016 · 2 comments
Open

Missing functions: foldr, reverse #26

rohieb opened this issue Apr 28, 2016 · 2 comments
Milestone

Comments

@rohieb
Copy link

rohieb commented Apr 28, 2016

I'm trying to reduce an array right-to-left. In Haskell, I would use foldr for that, but that's missing in luafun. Alternatively, one could build it by applying foldl to a reversed array, but the reverse function is also missing. I think both functions should be present in a good functional library.

@rtsisyk
Copy link
Member

rtsisyk commented Apr 28, 2016

Hi, I don't know how to implement foldr on iterators (which are left to right directed).

@HeinrichHartmann
Copy link

Indeed, reversal of iterators is not possible, cf. infinite case.

You can however, create an iterator from a table, that traverses in reverse order. Cf. #27

@kyukhin kyukhin added this to the wishlist milestone Oct 15, 2021
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

4 participants