Tag: functional programming
-
Failure.kt – A Tiny Stacktrace Library on top of Arrow’s Either
by
Some time ago, I wrote a detailed blog post on how and why to use Arrow’s Either type to model non-exceptional errors as a part of the domain model in Kotlin. In this post, I would like to present my own tiny Kotlin library which is intended to be used in conjunction with Arrow’s Either.…
-

-

An Introduction to Functional Programming with Kotlin
At the last BOB-conference I gave a tutorial about functional programming (fp) with Kotlin. I approached the topic starting from the basic properties of fp and how this can be done using Kotlin. Then, I moved to to a little bit more sophisticated topics regarding the use of fp in the real world with some…
-
Untyped Typescript or Error Prone Covariance
Some time ago I wrote this short article about co- and controvariance in Kotlin and how these features help the developer to write less error prone code. When I talked with some colleagues about TypeScript, I recognized that, despite some experiences I made with small pet projects, I do no know about type variance in…
-
Haskell is Faster than Rust! … Wait a Sec!
by
To evaluate the impact of memory management in Rust, I implemented a short benchmark in Rust and Kotlin. You can find all the details here and here. Measurements showed that Rust is roughly a factor of 10 faster than Kotlin, most probably caused by better handling of memory garbage. Being a big fan of Haskell,…
-
Kotlin/JVM, Rust, and Randy Random
by
In this previous article I implemented a small, enterprisy benchmark to compare the concept of garbage collection used by Kotlin/JVM with the concept of Rust, which claims to not have any garbage collector at all. My conclusion was, that for a moderate increase in the complexity of the programming language the benchmark in Rust performed…
-
Yes, Rust has Garbage Collection, and a Fast One
Rust is getting more and more popular. Thus, a group of colleagues, including myself, evaluated it for half a day to build up our own opinion, if Rust is of strategic interest for us or not. We did some coding following the standard introduction book, looked at some frameworks, and watched the presentation “Considering Rust”.…
-
Unbounded Functional Loops in Kotlin
This article is a follow-up to this previous article about bounded loops. Bounded loops are cool because they always terminate and usually it is pretty easy to estimate the computational time. But as every computer scientist, who had to understand the halting problem, knows, there is a big class of algorithms which are harder. These…
-
Java Optional and Kotlin Nullable
by
We are using Kotlin and Spring Boot in one of our projects. This includes Spring Boot Jpa Repositories. We are using a CrudRepository that provides basic functionalities like save(), delete(), findById() etc. This library is written in Java, hence method signatures look like this: Using this API out of the box would force us to…
-
Bounded Functional Loops in Kotlin
by
Loops are a basic paradigm in imperative programming languages. In functional languages you also need to loop, but you do it differently. Here, I present how I prefer to implement loops in a functional style using Kotlin. To check, if this is a good idea at all, I do some benchmarks against imperative variants and…

You must be logged in to post a comment.