--

Don't mention monads, when introducing the idea of railway oriented programming using one of these libraries, it unnecessarily complicates things. You can introduce a library like arrow.kt gradually, starting with using a simple result type (Either) which has some advantages over the Kotlin Result (like the NOK case not necessarily being a Throwable) and then start using it in more elaborate ways. There's e.g. a Retrofit adapter that returns an Either<CallError, OutApiResponse> so you go straight to a result type, no more wrapping with runCatching or something similar. From there it's a short path to using either { and bind(). It takes time but it's worth it and it's not just better looking syntax, it makes writing correct code easier and it's ultimately also easier to read (for everyone in the team).

--

--

No responses yet