validated<E, Int> {
val x: Int = validatedA.bind()
val y: Int = validatedB.bind()
x + y
}
If
validatedA
is
E
, then we can never advance this computation unless you have some value for
x
. So
validatedB.bind()
can never be executed, nor can its errors be accumulated.
y
Yannick Lazzari
08/12/2022, 12:31 PM
Yeah ok, makes that it doesn't work. My Haskell is somewhat primitive and rusty, I somehow thought the validation datatype was able to accumulate errors on bind and that we could potentially port over the solution to Kotlin, but I saw the comments on this bindValidation function that say in other words what you just said above.