Is there a shortcut for the following code snippet?
while (true) {
  val newClusters = this.iterate(instances, clusters)
  if (newClusters == clusters) {
    return clusters
  }
  clusters = newClusters
}
I would like to calculate the fixed point, i.e. execute a function such that its result is stable. Are you aware of any higher-order functions that would suit my purposes?
 
     
     
    