I'm looking at the implicit class example in the Scala Docs:
object Helpers {
implicit class IntWithTimes(x: Int) {
def times[A](f: => A): Unit = {
def loop(current: Int): Unit =
if(current > 0) {
f
loop(current - 1)
}
loop(x)
}
}
}
Can someone please explain this syntax and functionality?
times[A](f: => A)