Make scan accept a BinaryFunction.