Set of libraries with some basic types for Kotlin to support domain-driven functional programming.
Incorporated concepts are Railway-Oriented Programming (ROP) and Domain-Driven Design (DDD).
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation("com.github.VirtusLab.base-types-kt:rop-reactor:<version>")
implementation("com.github.VirtusLab.base-types-kt:rop-rx2:<version>")
implementation("com.github.VirtusLab.base-types-kt:refined-types:<version>")
}
-
Refined data types
RawText
NonEmptyText
NonEmptySet
Digit
WholeNumber
NaturalNumber
NonNegativeRealNumber
- ...
-
ROP with Project Reactor
MonoResult
=MonoK<Either<E, V>>
FluxResult
=FluxK<Either<E, V>>
CompletableResult
=MonoResult<E, Nothing>
- ...
-
ROP with RxJava 2
SingleResult
=SingleK<Result<T, E>>
- ...
Everyone is more than welcome to contribute!
To build, run: ./gradlew clean build
- Create a GitHub issue for a feature or a bug fix
- Fork project
- Raise a Pull Request
- Refinement types concept: https://en.wikipedia.org/wiki/Refinement_type
- Refinement types for Haskell: https://nikita-volkov.github.io/refined/
- Railway-oriented programming: https://fsharpforfunandprofit.com/posts/recipe-part2/