Skip to content

Remove redundant bind/forwardargs calls

F.bind(G,H), when given arguments x0,x1,... computes F( G(x0,x1,...), H(x0,x1,...) ) -- so F.bind(G), given x0,x1,..., is doing F( G(x0,x1,...) ) which is exactly what F @ G does. Basically, it makes no sense to do a bind and then only have a single argument.

Similarly FORWARDARGS is just an identity -- as a result F @ FORWARDARGS is really the same as F.

Finally, FORWARDARG0 given x0,x1,... returns x0, FORWARDARG1 given x0,x1... returns x1. So F.bind(FORWARDARG0, FORWARDARG1) given x0,x1 does F(x0,x1), which is exactly what F does by default. The only difference would be if more than two arguments would be provided, and F only accepts two. In that case, the 'bind' would just use the first two, ignoring the rest, whereas just using F would fail.

This MR removes a few of the above redundant obfuscations

Edited by Gerhard Raven

Merge request reports

Loading