Λrrow is a library for Typed Functional Programming in Kotlin.
Arrow aims to provide a lingua franca of interfaces and abstractions across Kotlin libraries.
For this, it includes the most popular data types, type classes and abstractions such as Option
, Try
, Either
, IO
, Functor
, Applicative
, Monad
to empower users to write pure FP apps and libraries built atop higher order abstractions.
Use the list below to learn more about Λrrow's main features.
- Documentation
- Patterns: tutorials and approaches to day-to-day challenges using FP
- Libraries: all the libraries provided by Λrrow
- Type classes: defining behaviors for data
- Data types: common abstractions
- Effects: interfacing with external systems
- Optics: inspecting and modifying data structures
Make sure to have the latest version of JDK 1.8 installed.
Add it in your root build.gradle
at the end of repositories.
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
Add the dependencies into the project's build.gradle
def arrow_version = "0.8.0"
dependencies {
compile "io.arrow-kt:arrow-core:$arrow_version"
compile "io.arrow-kt:arrow-syntax:$arrow_version"
compile "io.arrow-kt:arrow-typeclasses:$arrow_version"
compile "io.arrow-kt:arrow-data:$arrow_version"
compile "io.arrow-kt:arrow-instances-core:$arrow_version"
compile "io.arrow-kt:arrow-instances-data:$arrow_version"
kapt "io.arrow-kt:arrow-annotations-processor:$arrow_version"
compile "io.arrow-kt:arrow-free:$arrow_version" //optional
compile "io.arrow-kt:arrow-instances-free:$arrow_version" //optional
compile "io.arrow-kt:arrow-mtl:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-instances:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-rx2:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-rx2-instances:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-reactor:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-reactor-instances:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-kotlinx-coroutines:$arrow_version" //optional
compile "io.arrow-kt:arrow-effects-kotlinx-coroutines-instances:$arrow_version" //optional
compile "io.arrow-kt:arrow-optics:$arrow_version" //optional
compile "io.arrow-kt:arrow-generic:$arrow_version" //optional
compile "io.arrow-kt:arrow-recursion:$arrow_version" //optional
compile "io.arrow-kt:arrow-instances-recursion:$arrow_version" //optional
compile "io.arrow-kt:arrow-integrations-retrofit-adapter:$arrow_version" //optional
}
For projects that wish to use their own @higherkind
, @optics
and other meta programming facilities provided by Λrrow
the setup below is also required:
Add the dependencies into the project's build.gradle
apply plugin: 'kotlin-kapt' //optional
apply from: rootProject.file('gradle/generated-kotlin-sources.gradle') //only for Android projects
def arrow_version = "0.8.0"
dependencies {
...
kapt 'io.arrow-kt:arrow-annotations-processor:$arrow_version' //optional
...
}
gradle/generated-kotlin-sources.gradle
apply plugin: 'idea'
idea {
module {
sourceDirs += files(
'build/generated/source/kapt/main',
'build/generated/source/kapt/debug',
'build/generated/source/kapt/release',
'build/generated/source/kaptKotlin/main',
'build/generated/source/kaptKotlin/debug',
'build/generated/source/kaptKotlin/release',
'build/tmp/kapt/main/kotlinGenerated')
generatedSourceDirs += files(
'build/generated/source/kapt/main',
'build/generated/source/kapt/debug',
'build/generated/source/kapt/release',
'build/generated/source/kaptKotlin/main',
'build/generated/source/kaptKotlin/debug',
'build/generated/source/kaptKotlin/release',
'build/tmp/kapt/main/kotlinGenerated')
}
}
Copyright (C) 2017 The Λrrow Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.