Matching BigInts in Scala
Write your own extractor:

object Big {
  def unapply(n:BigInt) = Some(n.toInt)
}

//usage
def f(b:BigInt) = b match {
   case Big(0) =&gt; "none"
   case Big(1) =&gt; "one"
   case _ =&gt; "many"
}


Obviously, this isn't the fastest solution, but I think, it's quite idiomatic...