Dual

From NARS2000
Jump to navigationJump to search
Z←{L} fg R applies the function g then f and then g⍣¯1 to or between the arguments.
L is an optional array.
R is an array.
f is an arbitrary ambivalent function.
g is an arbitrary monadic function with an inverse.

Introduction

The concept of the Dual operator was described in Ken Iverson's paper on Operators and Functions.



Implementation

This operator is implemented via the anonymous function:

{⍺←⍣0 ⋄ ⍵⍵⍣¯1 (⍵⍵ ⍺) ⍺⍺ ⍵⍵ ⍵}