Arrow
Functional programming library for Kotlin. Provides typed error handling (Either, Option, Validated), effect system for pure functional I/O, optics for data transformation, and functional data types. Arrow fills the gap between Kotlin's pragmatic OOP style and pure functional programming — brings Haskell/Scala concepts to Kotlin idiomatically. Core feature in Arrow 1.2: Typed Errors using raise context and Either<Error, Value>.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Pure library — no network or IO by default. Functional style makes side effects explicit, which improves security by design. No credential handling. Actively maintained community project.
⚡ Reliability
Best When
Your Kotlin team is comfortable with functional programming and you want typed, composable error handling that makes invalid states unrepresentable in agent code.
Avoid When
You want simple Kotlin without FP overhead — Kotlin's Result<T>, sealed classes, and extension functions handle most use cases without Arrow's abstractions.
Use Cases
- • Replace exception-driven error handling in agent code with typed Either<Error, Value> returns that force callers to handle both success and failure paths
- • Build functional agent pipelines using Arrow's Effect and coroutines integration for composable, pure error propagation
- • Use Option<A> to represent nullable values with functional transformation (map, flatMap, fold) instead of null-check chains
- • Apply Arrow Optics for deep immutable data structure transformations in agent state management — lens/prism/traversal patterns
- • Use Arrow's Raise context with either { } DSL for railway-oriented programming in Kotlin agent workflows
Not For
- • Simple Kotlin projects that don't need FP abstractions — Kotlin's built-in Result type and null safety handles most cases without Arrow's overhead
- • Teams unfamiliar with FP concepts — Arrow's abstractions have a learning curve; introducing Either and Monads to non-FP teams requires investment
- • Java interop-heavy codebases — Arrow's Kotlin-idiomatic types (Either, Option) don't interop cleanly with Java code
Interface
Authentication
Library — no authentication concepts. Arrow is pure Kotlin code with no network calls.
Pricing
Community-maintained open source library. Apache 2.0 license.
Agent Metadata
Known Gotchas
- ⚠ Arrow 1.x deprecates many Arrow 0.x APIs (IO, Validated, Nel) — migrating between major versions requires significant refactoring; verify API against your target version
- ⚠ either { } DSL with raise requires the Raise<E> context receiver — not compatible with all Kotlin compiler versions; requires Kotlin 1.8+ with context receivers enabled
- ⚠ Either.catch {} catches Throwable including Error subclasses — be explicit about what exceptions to catch vs propagate to avoid swallowing fatal JVM errors
- ⚠ Arrow's Option<A> is redundant with Kotlin's nullable A? type — mixing both in a codebase creates confusion; prefer Kotlin null safety over Option in new Kotlin code
- ⚠ Optics code generation via KSP requires the arrow-optics-ksp-plugin Gradle plugin — forgetting this produces NoSuchMethodError at runtime, not compile time
- ⚠ Arrow's suspend functions and Effect require Kotlin coroutines — running Arrow Effect outside coroutine scope throws IllegalStateException; always call from coroutine context
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Arrow.
Scores are editorial opinions as of 2026-03-06.