Scala corresponds example
The “corresponds” function lets you match up items between two lists. For a good use of this, imagine you have a list of values, and a list of ranges (e.g. numeric or time windows): val a = List(1, 2, 3, 4) val b = List((1,4), (2,5), (3,7), (3,11)) From that, you can write a function …