I have a method that uses foldLeft in Scala.
def bitSetToByte(b:collection.BitSet, sh:Int=0) =
((0 /: b) {(acc, input) => acc + (1 << (input - sh))}).toByte
The method has two parameters for the anonymous function, so I replaced it with _ by removing formal arguments.
def bitSetToByte(b:collection.BitSet, sh:Int=0) = ((0 /: b) {(_ + (1 << (_ - sh))}).toByte
The issue is that I have type mismatch error message.
What might be wrong?