-
Notifications
You must be signed in to change notification settings - Fork 449
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
Pattern matching with KClass
and KProperty
#3449
Conversation
Kover Report
|
Sorry for the hold-up @serras. This is on my backlog for asap. |
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.
Couple of small nits, and questions.
Also, does arrow-match belong to arrow-optics if it doesn't depend on optics? Maybe we can consider putting it completely separate, or under core as well. Wherever you think this fits best.
arrow-libs/optics/arrow-match/src/commonMain/kotlin/arrow/match/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/optics/arrow-match/src/commonMain/kotlin/arrow/match/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/optics/arrow-match/src/commonMain/kotlin/arrow/match/Builders.kt
Outdated
Show resolved
Hide resolved
arrow-libs/optics/arrow-match/src/commonMain/kotlin/arrow/match/Builders.kt
Outdated
Show resolved
Hide resolved
I'm not really sure about where it should be. In my mind it goes in optics because it's about immutable data inspection, like optics. Also, I fear we end up with a super-big |
This is a generalization of #3442, but using
kotlin.reflect
APIs instead of optics (and only the part in the standard library, so we actually do not depend on thekotlin.reflect
library). The result doesn't look so nice, but it can still be very useful.Implementation note: I started with even shorter code, without
.of
(Person::name(Name::firstName)
). However, it turns out that this is reserved syntax, so I had to come up with a small name instead.