FP in Kotlin with Arrow with Jorge Castillo

  4 days


Kotlin has quickly become a major player in the Functional Programming arena for its streamlined features, ease of compatibility and versatility, as well as official support by Google for Android development.

With its multiplatform capabilities and increasing popularity for backend development, Kotlin allows you to transition your code and logic to different platforms.

You’ll learn the fundamentals and be introduced to Arrow, a popular open-source library that brings the ability to use functional programming in Kotlin by serving as a companion to the Standard Library.

Functional Programming in Kotlin with Arrow with Jorge Castillo

This course combines virtual classroom lectures and hands-on guided exercises designed to help attendees gain the tools necessary to develop and execute functional programming projects in the real world.

Upon completion of this Functional Programming in Kotlin with Arrow course you’ll be well on your way to developing and executing your own projects.

This course will be offered virtually over 4 half‑day sessions.

Our virtual courses offer the same expert-led, hands-on experience we've offered since 2013 — accessible from the comfort of your own home (office).

You’ll join Jorge and participants from around the globe in a virtual classroom where you’ll utilize collaboration tools like Zoom, Slack, and the 47 Degrees Academy IDE to learn, discuss, and evaluate real-world scenarios in development.

Online Courses for Software Professionals at Skills Matter

Learn how to:

This intensive course will cover:
  1. Functional Programming essential
  2. Domain Modeling and ADTs
  3. Immutable Data and Optics
  4. Error-Handling and Data Validation
  5. Diving into Suspend
  6. Arrow Fx Coroutines
  7. Resource Safety
  8. Functional Streams

About the Author

Jorge Castillo

Jorge Castillo is the Kotlin/Android tech lead at 47 Degrees. He comes from a heavily Android-oriented background, having also worked with Functional Programming more extensively during the later years.

Available dates

Dates coming soon

Can't make it on any of these dates?
Our team is happy to discuss other options with you.
Contact us at and mention ref: KOTLINFP-JC-02.
Private tuition and large-group discounts are also available. Find out more here.

Who should take this workshop?

This course is for developers who want to straighten their knowledge in Kotlin.


One year of experience using Kotlin or similar Functional Programming-oriented languages.

Workshop Outline

Lesson 1: Functional Programming
  • Functional programming essentials
    • Fundamentals of FP. What is it, what is it good for
    • Purity, referential transparency, substitution model
    • Side effects
    • Higher order functions
Lesson 2: Domain Modeling and ADTs
  • Modeling your program’s data through the concept of Algebraic Data Types
    • Kotlin type system and its impact on how compiler understands code
    • Algebraic Data Types
    • Modeling program choices by ADTs
    • The Nothing bottom type and inference
    • Kotlin standard library product types
    • Arrow product and sum types
    • Arrow Coproducts
    • Arrow Union types (powered by Arrow Meta)
    • Refined types (powered by Arrow Meta)
Lesson 3: Immutable Data and Optics
  • How to optimize reusability and composition for immutable data structures using Optics
    • Understanding optics as a path for reading / modification
    • How optics improve Kotlin standard library copy syntax
    • Going over all the available types of optics
    • Optics composition and reusability
Lesson 4: Error-Handling and Data Validation
  • Learning how to handle errors in our programs.
    • Learning how to handle errors in our programs.
    • Option datatype
    • Either datatype
    • Computational bias: Having a happy path in our types
    • Fail fast vs error accumulation strategies
    • ValidatedNel as a mean to accumulate errors
    • How to handle errors on concurrent contexts
Lesson 5: Diving into Suspend
  • Suspend from Kotlin stdlib, what it represents, how it works
  • What does suspend translate to at compile time (CPS)
  • How we leverage that with Arrow Fx Coroutines
  • The power of delimited continuations, "the mother of all monads"
  • Equivalence between wrapped approaches and Kotlin suspend
  • Removing the need for IO wrappers
  • Suspend as a mean to track side effects at compile time
Lesson 6: Arrow Fx Coroutines
  • A pure functional implementation of Kotlin suspend system
  • Handling errors in concurrent contexts by leveraging suspend + Either
  • Concurrency solved by Arrow Fx Coroutines operators
  • Collaborative cancellation checked by all operators
  • Cancellable effects
  • Evaluating effects on arbitrary contexts
  • Fibers as lightweight threads: ForkAndForget / ForkConnected / ForkScoped
  • Concurrent resource safety
  • Handling concurrent mutable state
  • Parallelization operators
  • Traversing effects
  • Racing effects
Lesson 7: Resource Safety
  • Resource
  • Bracket
Lesson 8: Functional Streams
  • Lightweight streams
  • Pull based - key differences vs other known streaming libraries
  • Built-in backpressure
  • Chunk based streams
  • Embedded effects
  • Stream interruption
  • Queues
  • Lightweight stream apis
  • Safely streaming resources with automatic scoping

FP in Kotlin with Arrow with Jorge Castillo
Dates coming soon