I hereby claim:
- I am jcazevedo on github.
- I am jcazevedo (https://keybase.io/jcazevedo) on keybase.
- I have a public key ASCmfreJ1r74yTTw82epE3z6HZSH4OqfyxtHGrCCVNy2xAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| import scala.util.Random | |
| object PStack { | |
| type Any = PStack[_, _] | |
| } | |
| sealed trait PStack[A, B <: PStack.Any] { | |
| def pop2: Option[(A, B)] | |
| def push0[C](elem: C): PStack[C, PStack[A, B]] = | |
| NonEmptyPStack(elem, this) |
| import scala.actors.Future | |
| import scala.actors.Futures._ | |
| object SleepSort { | |
| def main(args: Array[String]) = { | |
| var sorted = List[Int]() | |
| var futures = for (a <- args) yield future { | |
| Thread.sleep(a.toInt * 1000) | |
| sorted :::= List(a.toInt) | |
| a.toInt |