Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Nullable mapN #189

Merged
merged 11 commits into from
Jul 22, 2020
Merged

Nullable mapN #189

merged 11 commits into from
Jul 22, 2020

Conversation

tapegram
Copy link
Contributor

@tapegram tapegram commented Jul 20, 2020

#159

Implemented mapN for up to 9. Tried to minimize the differences in implementation so lower arity's reuses higher arity implementations. IMO, it would have been ideal to implement this with partial application, where each arg of fn is applied as it is determined to not be null, and just short-circuiting with null otherwise, but I'm not sure if that is currently possible to implement in a reasonable way.

@tapegram tapegram marked this pull request as ready for review July 21, 2020 02:27
@aballano aballano self-requested a review July 21, 2020 10:14
Copy link
Member

@aballano aballano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution, it looks pretty well 👌 Just some nits and comments. Regarding the tests, since I'm doing a migration to kotest I'll adapt them when this PR is merged, so just using Gen is fine for now :)

arrow-core-data/src/main/kotlin/arrow/core/Nullable.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
arrow-core-data/src/main/kotlin/arrow/core/Nullable.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
arrow-core-data/src/test/kotlin/arrow/core/NullableTest.kt Outdated Show resolved Hide resolved
@tapegram tapegram requested a review from aballano July 21, 2020 20:49
Copy link
Member

@aballano aballano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good from my side, thank you @tapegram!

@nomisRev
Copy link
Member

Very nice work @tapegram! Thanks and congrats for your first contribution 👏 👏 👏 🎉 🎉 🎉

@aballano aballano merged commit 939a47b into arrow-kt:master Jul 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants