-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 FunctionN.liftN, parLiftN #4340
base: main
Are you sure you want to change the base?
Conversation
I think I'd like to add the parallel versions too, but I don't want to invest additional time without some buy-in from the maintainers: let's talk about these first :) |
I like the idea. I don't think I like the tupledF name. I think we should iterate on that a bit. Maybe mapTuple? I don't know. |
I'm fine with pretty much any names ;) |
that's pretty cool, I didn't know about it. Frankly I'd still like to have something like this PR in cats because not everybody uses kittens, plus
|
Sure, I'm not arguing against this PR - just pointing out one could use kittens in the meantime. |
@joroKr21 That said,
They may both have merit, though: I don't have a strong opinion on whether |
Added |
Ah ok, the implementation is |
+1 on this to re-raise attention :) |
Removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
merging with main apparently broke something, I'll take a look. |
I forgot to write down the failing hash and the logs are now gone :( |
Here is the log: https://github.com/typelevel/cats/actions/runs/8066611292/job/22035078228#step:13:7049
|
liftN
is just likemapN
, but it should provide better type inference - if you have 6 effects to put in a tuple, you can make a mistake in one and suddenly the whole tuple no longer has amapN
methods. WithliftN
, you put the function first, and only then pass the (wrapped) elements.Consider this:
tupledF
is the same thing, but when your tuples are already in an effect - this can happen if you're unable to do.tupled
(e.g. combining cats-parse'sParser
+Parser0
- cc @johnynek) or you're just not in control over how the tuple is produced in the effect.tupledF
has been removed from this PR, we can revisit it in the future.