fun sumTwoNumbersFromTheOutside(): IO = IO.fx { val (firstNumber) = getNumberFromService() val (secondNumber) = getAnotherNumberFromService() // I want this to be deferred and executed to the end, but not to make // the whole thing fail. pureEffectNotCriticalToBusiness() return firstNumber + secondNumber } fun getNumberFromService(): IO { // Something that might fail. return 1 } fun getAnotherNumberFromService(): IO { // Something that might fail. return 2 } fun pureEffectNotCriticalToBusiness(): IO { // Something that might fail but should not stop the show. }