Functional programming with Arrow in Kotlin

  • Raghunath Mobile Ragunath Jawahar
Dz Q L1b VYAAEQL

With a rising trend in programming languages adding more and more functional capabilities, developers are working at a much higher level of abstraction. The declarative style of programming allows us to write readable and maintainable code that focuses on "what" (larger picture) rather than "how" (nuts and bolts). Functional programming also promotes immutability by default which makes dealing with concurrency an easy and a fun affair. Kotlin already supports some of these features like functions as first-class citizens, lambdas, anonymous functions, immutability, persistent collections, explicit nullable and non-nullable types, declarative constructs, etc., However, these features lack capabilities offered by purely functional languages.

Arrow is a Kotlin library that pushes the envelope further by introducing typeclasses, functional data types, optics, etc., It achieves this by clever usage of Kotlin language features and by generating code using annotation processors.

This talk will walk you through several ideas and code examples that will help you get started with functional programming using Arrow.

Audience will be able to:

  • Use functional data types from the Arrow library.
  • Use functional programming patterns.
  • Solve problems using functional ideas and gradually move away from imperative programming.
  • Deal with immutability and use optics to modify deeply nested data structures efficiently.