Skip to main content

⊘ — Valences

Dyadic operator. Keys: Alt-o /. Hanzi: 兼

f⊘g calls f with one argument and g with two. Either side can be a dfn with any number of statements.

f←(2×)⊘+
f 5                ⍝ 10
3 f 5              ⍝ 8

A dfn can also serve both cases, because an absent α drops out of the expression that uses it: {α-ω}3 is ¯3. See dfns.

A subject operand that holds no function acts as a constant function. α 0⊘1 ω tests for a left argument: 1 with two arguments, 0 with one.

{α 0⊘1 ω}5         ⍝ 0
3{α 0⊘1 ω}5        ⍝ 1

APL difference: Dyalog has no Valences operator. BQN writes it as ⊘ too.

Inverse

(f⊘g)⁻ inverts f with one argument and g with two.

(÷⊘-)⁻4   ⍝ 0.25