-- improved binary result pipeline to accept lambdas with parameterised
input and output types