bj0
08/20/2024, 5:20 PMmapOrAccumulateYoussef Shoaib [MOD]
08/20/2024, 5:22 PMlist.withIndex().mapOrAccumulate { (index, element) ->
  withError({ e: MyErrorType -> e to index }) {
    
  }
}bj0
08/20/2024, 5:24 PMYoussef Shoaib [MOD]
08/20/2024, 5:26 PMbj0
08/20/2024, 5:27 PMYoussef Shoaib [MOD]
08/20/2024, 5:27 PMPairbj0
08/20/2024, 5:28 PMYoussef Shoaib [MOD]
08/20/2024, 5:29 PMMyErrorTypebj0
08/20/2024, 5:30 PMEither<Any, T>Either<ErrorType, T>Youssef Shoaib [MOD]
08/20/2024, 5:36 PMmapOrAccumulatewithErrorbj0
08/20/2024, 5:56 PMAnybj0
08/20/2024, 5:56 PMranges.withIndex().mapOrAccumulate { (idx, range) ->
            val low = withError({ IndexedError(idx, it) }) { range.first.parseFreq() }
            val high = withError({ IndexedError(idx, it) }) { range.second.parseFreq() }
            ensure(low.valueInHz < high.valueInHz) {
                IndexedError(idx, InvalidInput("low value must be lower than high value"))
            }
            low to high
        }bj0
08/20/2024, 5:58 PMIndexedValue<T>