Skip to content

FoldableWithIndex and TraversableWithIndex instances for Cofree #126

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

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

postsolar
Copy link
Contributor

Description of the change

This PR adds Foldable f ⇒ FoldableWithIndex Int (Cofree f) and Traversable f ⇒ TraversableWithIndex (Cofree f) to Data.Comonad.Cofree. Indexing is "depth-based" and start at 0, the same way as it currently is for the respective Functor f ⇒ FunctorWithIndex Int (Cofree f). I tested each function in the REPL, but if necessary I will add some tests too to the PR.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@mikesol
Copy link

mikesol commented Sep 4, 2023

Good stuff! LGTM.

@garyb garyb merged commit 20e5cd9 into purescript:master Sep 5, 2023
@garyb
Copy link
Member

garyb commented Sep 5, 2023

Oops, this didn't have a changelog update so I'll add that.

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