Quickstart
Arrow is composed of different libraries; simply select the ones you need in your project.
All Arrow libraries are Multiplatform-ready, so you can use them in all of your KMP projects. Be aware that some instructions here may need to be slightly changed in that situation.
Enable the Maven Central repository
Arrow is published in Maven Central, so you need to enable it as a source of dependencies in your build.
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
repositories {
mavenCentral()
}
repositories {
mavenCentral()
}
Maven includes the Maven Central repository by default.
Include the dependencies
You're now ready to include Arrow in your project. You have three possibilities that correspond to three different ways of handling versioning in your build.
One by one
Simply include the desired library in your dependencies
block or as a
<dependency>
if you're using Maven.
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
dependencies {
implementation("io.arrow-kt:arrow-core:1.2.0-RC")
implementation("io.arrow-kt:arrow-fx-coroutines:1.2.0-RC")
}
dependencies {
implementation 'io.arrow-kt:arrow-core:1.2.0-RC'
implementation 'io.arrow-kt:arrow-fx-coroutines:1.2.0-RC'
}
<dependency>
<groupId>io.arrow-kt</groupId>
<artifactId>arrow-core</artifactId>
<version>1.2.0-RC</version>
</dependency>
<dependency>
<groupId>io.arrow-kt</groupId>
<artifactId>arrow-fx-coroutines</artifactId>
<version>1.2.0-RC</version>
</dependency>
Using version catalogs
Version catalogs provide centralized management of versions. This is especially interesting when your Gradle build has several subprojects.
- libs.version.toml (Common)
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
[versions]
arrow = "1.2.0-RC"
# other versions
[libraries]
arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" }
arrow-fx-coroutines = { module = "io.arrow-kt:arrow-fx-coroutines", version.ref = "arrow" }
# other dependencies
dependencies {
implementation(libs.arrow.core)
implementation(libs.arrow.fx.coroutines)
}
dependencies {
implementation(libs.arrow.core)
implementation(libs.arrow.fx.coroutines)
}
Version catalogs are only available in Gradle.
Using a Bill-of-Materials (BOM)
Another way to keep a single version for all Arrow dependencies in your build is
to include arrow-stack
, which declares versions for the rest of the components.
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
dependencies {
implementation(platform("io.arrow-kt:arrow-stack:1.2.0-RC"))
// no versions on libraries
implementation("io.arrow-kt:arrow-core")
implementation("io.arrow-kt:arrow-fx-coroutines")
}
dependencies {
implementation platform('io.arrow-kt:arrow-stack:1.2.0-RC')
// no versions on libraries
implementation 'io.arrow-kt:arrow-core'
implementation 'io.arrow-kt:arrow-fx-coroutines'
}
<dependency>
<groupId>io.arrow-kt</groupId>
<artifactId>arrow-stack</artifactId>
<version>1.2.0-RC</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- no versions on libraries -->
<dependency>
<groupId>io.arrow-kt</groupId>
<artifactId>arrow-core</artifactId>
</dependency>
<dependency>
<groupId>io.arrow-kt</groupId>
<artifactId>arrow-fx-coroutines</artifactId>
</dependency>
Additional setup for plug-ins
If you're using the Optics component of Arrow, we provide a Kotlin compiler plug-in that can derive most of the boilerplate required to use it. This plug-in is built with KSP, which requires an additional configuration step.
- Gradle (Kotlin)
- Gradle (Groovy)
- Maven
plugins {
id("com.google.devtools.ksp") version "1.8.10-1.0.9"
}
dependencies {
implementation("io.arrow-kt:arrow-optics:1.2.0-RC")
ksp("io.arrow-kt:arrow-optics-ksp-plugin:1.2.0-RC")
}
plugins {
id 'com.google.devtools.ksp' version '1.8.10-1.0.9'
}
dependencies {
implementation 'io.arrow-kt:arrow-optics:1.2.0-RC'
ksp 'io.arrow-kt:arrow-optics-ksp-plugin:1.2.0-RC'
}
There's no official support for KSP in Maven. This project provides unofficial support for that scenario.
Alphas (development builds)
For those wanting to live on the edge, we provide alphas of our development
branch. Those are tagged with the upcoming
version, followed by -alpha.
and the sequence number of the compilation.
Check Maven Central
for the most recent list of available versions.