Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 979 Bytes

which-each.md

File metadata and controls

33 lines (23 loc) · 979 Bytes

Which each?

Projection and Each are more general than Each Right and Each Left. A function can be projected on any of its arguments, and a function can be applied to each item of many lists. Each Right and Each Left apply binary functions only, itemwise right, or itemwise left.

Any expression involving Each Right and Each Left can be transformed into an equivalent expression using only projection and Each. For example:

1 2 3 foo/:10 20 30 40
foo[1 2 3;] each 10 20 30 40

Typically, expressions using Each Right and Each Left are easier to read, and certainly easier to write, than expressions couched in terms of projection and Each. For example

a foo/:\:b

expands to

({foo[x;]each y}[;b]) each a

Prefer Each Right and Each Left to projection and Each.