val の型ではなく、関数評価の結果に基づいてパターン マッチングを行う方法を探しています。例えば、
def f1(x:String):Boolean = if (x contains ("Helllo")) true else false
val caller="Hello"
caller match
{
case f1(caller) => println ("caller said hello")
case _ => println ("caller did not say hello")
}
何か案が ?