⍥) is a primitive dyadic operator which takes two function operands and produces a derived function which pre-processes the argument(s) using the monadic right operand, before applying the left operand on/between the result(s).
(g ⍥ h) ⍵
g (h ⍵)
When the resulting function is used dyadically, both arguments are pre-processed:
⍺ (g ⍥ h) ⍵
(h ⍺) g (h ⍵)
x←3 1 2 y←4 6 5 x +⍥(⌈/) y ⍝ add the max of x and max of y 9 ⍝ same as (⌈/x)+⌈/y 9
In SHARP APL and J, Over is implemented as a close composition, meaning that (using SHARP syntax)
f⍤g has the overall function rank of
g. J uses
& for the close form and
&: for the rankless form that appears in modern APLs.
Ken Iverson defined Over in 1978 as part of Operators and Functions, with the glyph
¨. He called it Composition, as there was no Atop operator. It was added to SHARP APL as a close composition with glyph
⍤ and name "on", with a limited implementation in 1981 followed by a full implementation in 1983 with the introduction of function rank.
- Ken Iverson. Operators and Functions, §8 Composition and Duality. IBM Research Report #RC7091. 1978-04-26.
- "Composition and Enclosure". SATN-41, 1981-06-20.
- "Language Extensions of May 1983". SATN-45, 1983-05-02.
- Composition. NARS2000 Wiki.
- Adam Brudzewsky. Chat message 42021088. APL Orchard. 31 Dec 2017.