Skip to content

traverseWithIndex_ for Seq #840

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

Closed
sjakobi opened this issue Jun 14, 2022 · 2 comments
Closed

traverseWithIndex_ for Seq #840

sjakobi opened this issue Jun 14, 2022 · 2 comments

Comments

@sjakobi
Copy link
Member

sjakobi commented Jun 14, 2022

…would be nice to have.

dhall previously used Data.Foldable.sequenceA_ (Data.Sequence.mapWithIndex f xs), but this is not optimal because it the result of mapWithIndex is materialized before being reduced by sequenceA_.

dhall-lang/dhall-haskell#2423 switches dhall to use itraverse_ from indexed-traversable which has a nice implementation in terms of Data.Sequence.foldMapWithIndex.

@meooow25
Copy link
Contributor

See also: #422 (comment)

@meooow25
Copy link
Contributor

Using indexed-traversable for this should be fine (#422 (comment)).

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

2 participants