juan_gandhi: (Default)
2017-05-22 10:33 am
Entry tags:

strangely categorical construct I needed

  private def diagonalize[T](f: Int => T): PartialFunction[(Int, Int), T] =
      { case (i, j) if i == j => f(i) }