I am experiencing a crash when using `parZip` insi...
# arrow
c
I am experiencing a crash when using
parZip
inside of an
either
block.
Copy code
suspend fun refresh(): Either<Throwable, Unit> = either {
    parZip(
        { refreshA().bind() },
        { refreshB().bind() }
    ) { dataA, dataB ->
        persistData(dataA, dataB).bind()
    }
}
But if one of the suspending functions doesnt return the proper type, the exception is not caught. The crash happens with an unsafe cast at line 85 of
ParZip.kt
f(a as A, b as B)
Is there any way to catch this exception? I feel like I would need to double wrap the Either
s
Hey @Charlie Christensen, I am unsure what this is related to. The code you shared should be correct, as it should be safe to use
parZip
inside of
either { }
. Could you share a longer or reproducible example so this could be investigated?