Difference between revisions of "Over"
Jump to navigation
Jump to search
(direct link) 

Line 2:  Line 2:  
== Explanation ==  == Explanation ==  
−  When the resulting function is used [[monadic]]ally, it has the same behaviour as if the [[Beside]] or [[Atop operator]] had been used:  +  When the resulting function is used [[monadic]]ally, it has the same behaviour as if the [[Beside]] or [[Atop (operator)Atop]] operator had been used: 
{  {  
<source lang=apl> (g ⍥ h) ⍵</source> {{←→}} <source lang=apl>g (h ⍵)</source>  <source lang=apl> (g ⍥ h) ⍵</source> {{←→}} <source lang=apl>g (h ⍵)</source> 
Latest revision as of 08:41, 22 November 2021
⍥

Over (⍥
) is a primitive dyadic operator which takes two function operands and produces a derived function which preprocesses the argument(s) using the monadic right operand, before applying the left operand on/between the result(s).
Explanation
When the resulting function is used monadically, it has the same behaviour as if the Beside or Atop operator had been used:
(g ⍥ h) ⍵

g (h ⍵)

When the resulting function is used dyadically, both arguments are preprocessed:
⍺ (g ⍥ h) ⍵

(h ⍺) g (h ⍵)

Examples
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