Skip to content

Instantly share code, notes, and snippets.

object Kernel {
implicit class Times(val n: Int) extends AnyVal {
def times[T](block: => T) = for (i <- 1 to n) yield block
def times[T](block: Int => T) = for (i <- 1 to n) yield block(i)
}
implicit class RunnableConversion(block: => Unit) extends Runnable {
def run = block
}