Arrow operator and empty sequences

Can't recall whether this was discussed previously, so here it goes.

In most (but not all) expressions, if either part is an empty sequence, the result of the expression is the empty sequence. The arrow operator very much reads like "take this on the left and feed it to the right", much like the pipe operator in DOS or Unix, or the pipe operator in functional languages.

In functional languages, if input is empty, the rest can be ignored: a |> b |> () |> dosomething(c). While this may evaluate a and be, after "()" you don't need to continue. 

However, we express the arrow operator *not* in the same way, in fact, we seem to say that () => concat("a") results in concat((), "a").

This is probably intended, but if not, I wonder if an optimizing processor may evaluate the right-hand side of this operator and stop evaluation if it concludes it is the empty sequence. Obviously, this would mean it is not 100% synonymous with a => b(c) being equal to b(a, c)

(if it is indeed intended, we may consider being explicit about it?)

Cheers,
Abel

Received on Thursday, 17 December 2015 16:45:32 UTC