Functional Android apps
summary
Claims that using Arrow Fx Coroutines plus Arrow functional streams yields a practical functional Android architecture: suspend flags side effects, an environment/runtime runs suspended programs, and operators provide structured concurrency, parallelism and cancellation. Shows concrete tooling: either/validated for error models, parTraverse and parallel parJoin for concurrent requests, evalOn for threading, schedule-based retry policies, stream callbacks and bracket for lifecycle and resources. Demonstrates how programs stay declarative until a suspended terminal runs them and how failures short‑circuit or accumulate.
AI-written summary · about
chapters (10)
- 0:00Intro
- 1:45Concern separation Staying declarative and deferred • Memory representation of the program (algebras). Decoupled runtime - optimizations. • Simple example: Kotlin Sequences terminal ops to consume - toList()
- 6:52Android architecture? We can leverage the same idea using suspend Flags a potentially blocking long running computation effect • Enforces it to run under a prepared environment (Coroutine). • Makes the effect compile time tracked.
- 8:45But we'll need a runtime Every suspended program requires an environment (runtime) to run Suspend makes our program declarative + description of effects. • Crawls the call stack up until the integration point coroutine launch.
- 10:22Environment in FP • Arrow Fx Coroutines Environment.
- 17:31Nullable data Option getting deprecated. Alternative 1: A? • Alternative 2: Either
- 24:39Sequential effects - bindings Alternative syntax Either bindings sugar
- 31:24Limitations • Either or Validated are eager. We want them deferred declarative. • suspend will do the work But what about threading/concurrency?
- 32:19A. Arrow Fx Coroutines Functional concurrency framework. • Functional operators to run suspended effects. • Cancellation system 7 + All Arrow Fx operators automatically check for cancellation
- 43:08What we need Emit multiple times Embed suspended effects. • Compatible with all the Arrow Fx Coroutines operators. . Cold streams - purity declarative. . Composition
related talks
34mFunctional Android
51mArrowFx: Functional Programming for the masses
32mFunctional Programming on Android
42mKotlin Coroutines: An Intro to Practical Use on Android
41mArchitectures Using Functional Programming Concepts
41mAn Arrow to the Kotlin
28mArrow Fx: Functional Domain Modeling with Kotlin
34mFunctional Programming in Kotlin for AndroidDevs
