title: Fixed point in Scala
body: <p>Is there a shortcut for the following code snippet?</p>
  
  <pre><code>while (true) {
    val newClusters = this.iterate(instances, clusters)
  
    if (newClusters == clusters) {
      return clusters
    }
  
    clusters = newClusters
  }
  </code></pre>
  
  <p>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?</p>