Hey folks, I’d like to share <KUnion>, a micro-lib...
# feed
g
Hey folks, I’d like to share KUnion, a micro-library which provides an ADT to represent discriminated union types in kotlin. Any review/feedback is welcomed!
a
url is invalid
g
Thanks for the report, mb, now probably should be ok.
1
s
Looks nice. QQ, though: How does your Union type fundamentally differ from the Either type (from Arrow-Kt)?
g
Tbh, they are not so much different since they both represent "either" A or B. But
Either
promotes railway programming. While I aimed to solve some specific problems at a large codebase which is using sealed classes to represent states, failures etc. I have wrote a Motivation paragraph in README.md in case you want to take a look. tl;dr i introduced this type to be more of a complimentary solution to regular direct kotlin style.
👍 1