CLOVIS
10/31/2020, 6:07 PMEither
...), I'm wondering how I could go around to make it ‘more functional'. I see that functions that return flows are better than simple suspend functions returning a list because the side effect doesn't happen during the function execution but is ‘stored' within the type.
I don't really see a way to do the same with ‘action' requests, apart from returning a Flow with a single value (or would you say that's good code?) If I understand, that's what IO
was for, but since it seems like it has been replaced by arrow-fx-coroutines
, I'd rather learn the ‘new version'
The other problem is the user interaction: currently, the user interaction consists of a few suspend functions that are called deeply inside the program. This way, it's not really possible for the ‘client' of the application to use a different UI. Usually this would be solved with Dependency Injection, but the Arrow wiki implies Typeclasses can assume that role in a better way.
Essentially, which steps would you take to change the architecture of this application so it's more functional? This particular project only runs on the JVM, if that changes anything, but I'd like to learn about techniques that work everywhere if that's possible. I've already went through and made all objects immutable, which should make the translation easier?julian
10/31/2020, 7:31 PMgeorg
10/31/2020, 7:48 PMpakoito
10/31/2020, 9:21 PMCLOVIS
11/01/2020, 9:17 AM