Is there currently any advice on building and cons...
# arrow
d
Is there currently any advice on building and consuming programs using the
Free
monad? Or should we be preferring
IO
for that?
r
Free is not very practical in Kotlin because in order to compose algebras you need a coproduct of types and FunctionK, inference suffers a lot ,
Additionally the Free Monad comes with no error handling or Concurrent instances
IO is a more complete API and it's itself a free Monad style algebra
d
Well that was sorta my plan - offload error handling to the handler. But yeah that means that I can't trap errors in the free dsl
r
You can if you declare your own error primitives but you won't be able to provide some combinators
Because some will require taking a free program as argument recursively and then you won't have access to the functionk of the entire coproduct
We had all those problems in freestyle in Scala