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 ifolded and imapped #146

Open
twhitehead opened this issue Aug 29, 2024 · 2 comments
Open

Add ifolded and imapped #146

twhitehead opened this issue Aug 29, 2024 · 2 comments

Comments

@twhitehead
Copy link
Contributor

The library has itraversed to give an IndexedTraversal for any TraversableWithIndex.

It would be also nice to have ifolded and imapped to give an IndexedSetter for any FunctorWithIndex and an IndexedFold for any FoldableWithIndex.

This would introduce no additional dependencies as both FoldableWithIndex and FunctorWithIndex are defined in the foldable-traversable package that is already depended on for TraversableWithIndex.

I'll submit a pull request shortly.

twhitehead added a commit to twhitehead/purescript-profunctor-lenses that referenced this issue Aug 29, 2024
twhitehead added a commit to twhitehead/purescript-profunctor-lenses that referenced this issue Aug 29, 2024
twhitehead added a commit to twhitehead/purescript-profunctor-lenses that referenced this issue Aug 29, 2024
twhitehead added a commit to twhitehead/purescript-profunctor-lenses that referenced this issue Aug 29, 2024
@twhitehead
Copy link
Contributor Author

Just stumbled across the fact that, while both folded and traversed are present, mapped is missing.

Not a big deal as, for profunctor lenses, it is just technically

mapped :: forall f a b. Functor f => Setter a b (f a) (f b)
mapped = map

Still maybe a good idea to throw it in for completeness?

Saves a few brain cycles when you reach for it and realize it isn't there. 😀

garyb pushed a commit that referenced this issue Sep 18, 2024
* Add `imapped` (#146)

* Add `ifolded` (#146)

* Update to latest package set

* Tweak CI system as suggested by @garyb in #147 to get it building
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants