-
-
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 unzip to Functor #3023
Comments
Is it okay if I pick this up? |
Wouldn't the implementation @julien-truffaut proposed invoke computation twice for the effect |
Also concerned about this. This would probably be fine in Foldable, but for effects it'll require evaluating twice or break referential transparency. |
We could call it |
I'd probably like it more with a comment than that name tbh 😆 let's see what others think |
The effect duplication seems pretty obvious in type (2 |
I don't think there is a way to unzip an effect without running it twice unless we do some memoization, but that's cats-effect territory. |
@joroKr21 even in cats-effect memoization without an additional effect breaks RT. |
Yes you would have to return |
PR merged, thanks everyone :) |
what do you think about adding
potentially we could have optimised version per type
reference https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List-NonEmpty.html#v:unzip
The text was updated successfully, but these errors were encountered: