val of: Int => Option[String] = { i =>
if (i == 2) {
Some("matched by an optional function")
} else {
None
}
}
util.Random.nextInt(4) match {
case of.unlift(m) => // Convert an optional function to a pattern
println(m)
case _ =>
println("Not matched")
}