^^^ turns out this was easier than I realized and ...
# arrow
f
^^^ turns out this was easier than I realized and didn't require anything fancy or smart
Copy code
return entries
    .asSequence() //turning it into a sequence first enables short circuiting on first encountered failure
    .map { callDownstreamForEntry(it) } //make the call to downstream
    .firstOption { outcome -> //find the first failure using the below filter
        outcome
            .fold({
                true //we got an error calling downstream - failure found - short circuit
            }, {
                it.not() //we got a false from downstream - failure found - short circuit
            })

    }.getOrElse { true.right() } //if we reach here there were no errors calling downstream and no false 
                                 //from downstream, so return success