I have published a Reference Guide for Arrow-fx 0....
# arrow
p
I have published a Reference Guide for Arrow-fx 0.10 to get you started! It covers everything from the basics of wrapping suspend functions and parallelism, to advanced use cases like safe resource management and program structure 📝 https://twitter.com/pacoworks/status/1206507788043718657
arrow 12
👏 12
s
I tried subscribing your blog. But I am getting some rss error.
p
hmmm ghost, my blog provider, is responsible for that
what's the problem?
s
Clicking on the subscribe button opens up a big XML file
p
yes, that's a css feed
you have to link that to a rss feeder service
I use feedly
s
Oh! Okay. I will do that.
p
@pakoito Thank a lot on this guideline. The example usage of each datatype and typeclass are really good.
I have a few question through.
p
sure, I'd suggest opening a new thread for them
p
Ok I will do so.
p
Great post Paco... In addition to the
bind()
extension function you could also mention the use of the
!
shortcut 🤔
p
for 1.0 is becoming
val a by IO
, so it's better if we start suggesting
.bind()
for now
!
and destructure had collisions when used with boolean or data classes
p
Not only with boolean or data classes ! When, i wrote my gist about Free, i found a collision in a recursive call ! I will update my gist with your recommandation...
Copy code
val eitherMonad = Either.monad<String>()
fun stackSafeEitherProgram(n: Int, acc: Int = 1) : Free<EitherPartialOf<String>, Int>  =
    eitherMonad.fx.stackSafe {
        val r = when {
            n == 1 -> !Right(acc)
            n > 1 -> stackSafeEitherProgram(n-1, acc * n).bind()
            else -> !Left("Invalid number!")
        }
        r
    }
p
👍🏼
a
@pakoito Great article! Am I Right that there should be
effect { renderPage(userPage) }.bind()
instead of
effect { renderPage(user) }.bind()
in one of the snippets?
p
Correct, I'll fix
m
@pakoito Thanks a lot for that great tutorial! Two things though regarding the cancellation via
Promise
to mimick lifecycle callbacks: • There is a typo
val endPromise: Promise<ForIo, Unit>
- should be
ForIO
as first type param • Exactly this line does not compile - complaining about failing type inference for
A