Remove functional-error-handling-in-kotlin-part-2
article thumbnail

Functional Error Handling in Kotlin, Part 2: Result and Either

Rock the JVM

By Riccardo Cardin In this series first part , we introduced some of the available strategies to handle errors in a functional fashion using Kotlin and the Arrow library. For the project’s setup, please refer to the first part of this series, in which we set up Maven and the needed dependencies.

Scala 69
article thumbnail

Type Classes in Kotlin: A Practical Guide

Rock the JVM

By Riccardo Cardin In this article, we delve into the concept of type classes in Kotlin, a powerful tool that allows developers to abstract logic for different data types. Our implementation will be based on the Arrow Kt library, which will exploit Kotlin’s context receivers. of Kotlin and version 1.2.1 of the Arrow library.

Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

article thumbnail

Functional Error Handling in Kotlin, Part 3: The Raise DSL

Rock the JVM

By Riccardo Cardin It’s time to end our journey on functional error handling in Kotlin with the new features introduced by the Arrow library in version 1.2.0, We’ll mainly focus on the Raise DSL, a new way to handle typed errors using Kotlin contexts. This article is part of a series.

article thumbnail

Functional Error Handling in Kotlin, Part 1: Absent values, Nullables, Options

Rock the JVM

Riccardo is a proud alumnus of Rock the JVM, now a senior engineer working on critical systems written in Scala and Kotlin. If you’d like to watch the video form of this article, please enjoy: The Kotlin language is a multi-paradigm, general-purpose programming language. Kotlin offers a lot of different methods to handle errors.

article thumbnail

Kotlin Flows - The Ultimate Guide

Rock the JVM

By Riccardo Cardin Video version: In the article Kotlin Coroutines—A Comprehensive Introduction , we saw how to use Kotlin Coroutines to write asynchronous code in a more natural and readable way. This article will focus on another crucial concept in Kotlin Coroutines: Kotlin flows. Flows Basics What is a flow in Kotlin?

article thumbnail

The Ultimate Guide to Java Virtual Threads

Rock the JVM

Riccardo is a proud alumnus of Rock the JVM, now a senior engineer working on critical systems written in Java, Scala and Kotlin. Here, we will just show the most important parts. class ); However, we won’t use the logger object directly in our example but the following custom function log : static void log ( String message ) { logger.

Java 145
article thumbnail

Kotlin Context Receivers: A Comprehensive Guide

Rock the JVM

By Riccardo Cardin This article will explore a powerful feature of the Kotlin programming language called context receivers. If you’re a Kotlin developer looking to write cleaner and more expressive code, context receivers are a tool you’ll want in your toolbox. Make sure you have Kotlin version 1.8.22 withType ().

Scala 52