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

Tuple2 map and mapSecond #30

Closed
evandrmb opened this issue Dec 23, 2021 · 1 comment
Closed

Tuple2 map and mapSecond #30

evandrmb opened this issue Dec 23, 2021 · 1 comment

Comments

@evandrmb
Copy link

Hi, I'm curious about why map and mapSecond behave exactly the same (according to docs). Shouldn't map allow users to change the type of both values in Tuple2?

I'm currently using version 0.0.12

@SandroMaglione
Copy link
Owner

Hi @evandrmb

The map method is an override of Functor2, this means that the type signature of the method is expected to be the same. For this reason, map is allowed to update only one value.

Nonetheless, I added a mapBoth method for this purpose.

Thanks for the feedback 👍

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

No branches or pull requests

2 participants