I'm fond of FP, but every time I think about adopt...
# arrow
u
I'm fond of FP, but every time I think about adopting it into my backend project I find no practical use of it. Obviously, I mean advanced topics which are solved by Arrow, not standard Kotlin FP tools like
data classes
, high order funcs and etc. Any comprehensive open-source project (preferable Kotlin+Spring) which heavily uses Arrow (core, optics) you could recommend to dig in?
👀 1
c
Not really an answer to your question, but I must say using
either { }
for request validation (checking that the parameters are correct, accessing the database, ...) feels very good.
p
Like with everything else, there's a plateau of productivity that's where most people feel confident and safe. We've done a lot of experimenting with Arrow for the sake of it, mostly with MTL (Reader, Writer, EitherT, etc), but also recursion schemes and such. It ended in the incubator bucket for a reason. If you stick to Either, Validated, nullable, collections, lambdas (what is arrow-core) and optics you have most of the tools to do single-threaded programming. For concurrent behavior we have arrow-fx, which gives you constructs that feel single-threaded but aren't. No semaphores, no actors, no locked sections. Mostly high level constructs like thread-safe mutable variables, run-in-parallel, and run-in-another-thread-because-the-framework-requires-it.