Error handling in software design often devolves into procedural code riddled with nested conditionals and complex workflows, making systems hard to test, maintain, and scale. Railway Oriented Programming (ROP - https://fsharpforfunandprofit.com/rop/) offers a structured, functional paradigm that clearly separates success and failure paths, enabling developers to simplify workflows and build more maintainable systems. This talk takes a step-by-step approach to refactoring procedural Kotlin code into a declarative, functional style using Kotlin and Arrow KT.
Drawing from my experience with Kotlin in Specmatic, we will explore real-world examples that highlight how Kotlin’s type system, extension functions, and immutability features can simplify error handling and empower developers to build maintainable, predictable systems. A special focus will be placed on the practical application of the Either monad in this context. Attendees will walk away with actionable steps to refactor procedural code into functional pipelines, improving readability, testability, and maintainability.