jean
04/30/2024, 6:15 AMTies
04/30/2024, 7:08 AMjean
04/30/2024, 7:12 AMTies
04/30/2024, 7:13 AMCLOVIS
04/30/2024, 7:29 AMI'm also looking for something showing why FP should be considered rather than traditional OOP.IMO that's the wrong way to approach this. Kotlin is right in the middle of OOP and FP. Arrow helps using more FP, but that doesn't mean you must not use OOP. For example,
kotlin.coroutines.flow.Flow
is 100% FP, but when introducing it in a codebase, you never try to convince people that FP is better. You just demonstrate the tool, and the tool brings features you can't have otherwise.
Think of Arrow in terms of the features it brings. Arrow brings typed errors, Arrow brings resilience mechanisms, Arrow brings deep copy of data classes, etc. It doesn't really matter that pure FP languages prefer this way of designing things: at the end of the day, these are all just new tools you have access to. In Kotlin, you don't have to choose the One Way.Ties
04/30/2024, 7:32 AMjean
04/30/2024, 8:31 AMDaniel Ciocirlan
04/30/2024, 3:52 PMCLOVIS
04/30/2024, 3:54 PMEither
everywhere is more verbose than using exceptions. Using Raise
is about the same amount of code, but really, Raise
is just a nicer API for throws
in Java, there's nothing particularly FP about it.CLOVIS
04/30/2024, 3:55 PMrunCatching
for error handling, it's not designed for it, and it will cause enormous bugs down the line, including zombie coroutines"jean
04/30/2024, 4:42 PMTies
04/30/2024, 4:44 PMjean
04/30/2024, 4:45 PMMarcus Ilgner
05/03/2024, 11:12 AM