https://kotlinlang.org logo
#announcements
Title
# announcements
i

ianrumac

11/11/2019, 4:13 PM
I wanted Unions so I hacked them in via annotations, if anyone needs them: https://github.com/lotuslambda/unikons
👍 2
p

pablisco

11/11/2019, 4:35 PM
@ianrumac I would watch this space: https://github.com/arrow-kt/arrow-meta/pull/64 And #arrow-meta We are always needing help if you want to contribute 🙂 cc: @raulraja
i

ianrumac

11/11/2019, 4:41 PM
saw that PR, that actually gave me the idea, I was like “heeeeey I want that too!” 😄 kudos @raulraja I’ve been wanting to get into arrow for a long time but never got time to dive into the lib, tracking it closely tho
🔜 1
👍 1
h

Hanno

11/11/2019, 4:53 PM
Nice! Shouldn't the example better be when(x) instead of when(x.value) for exhaustiveness?
i

ianrumac

11/12/2019, 9:48 AM
hey @Hanno, you think it should? I wanted to keep the generated classes private, maybe I could do it if I extended it to a compiler plugin
h

Hanno

11/12/2019, 9:52 AM
Why dont you want them to be completely reachable for the user as if they were hand written? :)
i

ianrumac

11/12/2019, 11:56 AM
didn’t feel like there was a need for them to take up autocomplete space and distract developers
h

Hanno

11/12/2019, 12:05 PM
Hmmm..but in Order to use the union classes, one has to switch over the underlying values, don't one? So it would be better to get completion for known types as well as exaustiveness, especially when the sealed subclasses names are derived from the union type entries :)
i

ianrumac

11/12/2019, 12:22 PM
I wanted to keep that ‘switch over’ as minimal as possible, so that you just wrap it with a function and expose the raw value, not the wrapper. I see what you mean tho, not a problem to implement, I’ll have to think and try which way would be better. Or provide a config option like ‘exposed : Boolean’
2 Views