Consider a dyadic verb gdefined in terms of a binary verb f:
g=. [ f&.|: f
Is it possible to rewrite gso that the member fappears only once, but the behavior has not changed?
UPDATE: Local context
This question arose as part of my solution to this problem , which "expands" the matrix in both directions:
Original matrix
1 2 3
4 5 6
7 8 9
Extended Matrix
1 1 1 1 2 3 3 3 3
1 1 1 1 2 3 3 3 3
1 1 1 1 2 3 3 3 3
1 1 1 1 2 3 3 3 3
4 4 4 4 5 6 6 6 6
7 7 7 7 8 9 9 9 9
7 7 7 7 8 9 9 9 9
7 7 7 7 8 9 9 9 9
7 7 7 7 8 9 9 9 9
My solution was to first expand the rows of the matrix using:
f=. ([
And then apply the same solution under transposition to expand the columns of an already expanded row:
3 ([ f&.|: f) m
, f inline...
!