A small coproduct library for Kotlin.
repositories {
maven { url 'https://dl.bintray.com/aedans/maven/' }
}
dependencies {
compile 'io.github.aedans:kop:1.0.1'
}
- Standard coproduct type
Coproduct a b = Left a | Right b
- Coproduct typealiases up to 26
- Coproduct.fold up to 26
- Coproduct.map up to 26
- Coproduct.value up to 26
- Kategory interop
The code generator is located here. Note that when adding a new generator method, you must also call it from build.gradle:codegen.
To increase the number of auto-generated utilities, there is a variable called num in build.gradle. However, you will have to build and publish to another Maven repository to use this change.