kyleg
05/25/2022, 2:59 PMIO<A>
hadn't been deprecated for suspend yet!).
Quick question: didn't Arrow used to have a Free/FreeMonad implementation? I can't seem to find it in the codebase or the docs now. I found a gist for creating a DSL using Arrow (written three years ago) but I can't even find annotations like @higherkind
to import them. It looks like there used to be a module arrow-free or something based on links in the gist, but I can't find that now.simon.vergauwen
05/25/2022, 3:28 PMIO
🤣)
We don't have @higherkind
or Free
anywhere anymore because we've found much better and more elegant solutions in Kotlin for all those use-cases.simon.vergauwen
05/25/2022, 3:29 PMkyleg
05/25/2022, 3:40 PM@higherkind
and the code it generated. https://gist.github.com/PhBastiani/26d8734ff33001cb0304df337ea936a1
If it's not available anymore, no big deal: I don't need it to solve my problem. Just wanted to try it out and then write my app async but tests sync, which I understand is a nice benefit of the free monad
Is there an Arrow pattern for this kind of thing now? Should I be using MonadError and fx and then at the edges deciding which specific monad to be using (so a DataRepository module might use Either/Option in tests but async/`suspend` in the actual app)?
Edit Seems like I misunderstood MonadError. Thought maybe it represented "monad that can succeed or fail but no other restrictions on the context"simon.vergauwen
05/25/2022, 3:46 PMsimon.vergauwen
05/25/2022, 3:47 PMmy app async but tests syncThis is not really a concern anymore for most people, since KotlinX Coroutines now officially has a test module exposing
runTest
simon.vergauwen
05/25/2022, 3:47 PMkyleg
05/25/2022, 4:10 PM