I see
afoldl(op,a) = a
afoldl(op,a,b) = op(a,b)
afoldl(op,a,b,c...) = afoldl(op, op(a,b), c...)
First statement
afoldl( &, 2 ) = 2
(&)(x::Integer) = x # this definition is not needed.
Second statement
afoldl( op, a, b ) = op( a, b )
afoldl( &, 2, 6 ) = (&)( 2, 6 ) # same as 2 & 6
(&)(x::Integer) = x # this definition is still not needed.
Therefore I’m still wondering: what’s the practical use of (&)(x::Integer) = x
Update: I didn’t look far enough.
($op)(a, b, c, xs...) = afoldl($op, ($op)(($op)(a,b),c), xs...)
# which may reduce to
afoldl( ($op)(z) )
However
($op)(a, b, c, xs...) = afoldl($op, ($op)(a,b), c, xs...)
# would reduce no further than
afoldl( ($op)(x, y) )
# which becomes the binary function call
$op(x,y)
Thus avoiding the need for a unary function.
But as I note further below, the current implementation is what it is. No point changing it.