// function arrays apply:{x[1;&~b]#x[0]eval\:((),y)@>x[1;&b:0>x 1]} eval:{:[4:x;{:[7=4:x;x[y];x]}/[x;y];,apply[x]y]} each:{@[x@[y;1;1_];1;{y,x};*y 1]} each2:{} array:{:[4:x;(x;1_-!1+y);((),x;(#x),1_-!1+y)]} atom:{0>|/x 1} list:{:[atom x;enlist x;x]} flip:{@[x;1;{(|2#x),2_ x}]} reverse:{@[x;1;|:]} enlist:{@[x;1;1,]} first:{@[@[x;1;{:[(#x)>i:(0f;2,s;,2]} same:{((x=m#y)?0)#x:(m:(#x)&#y)#x} transpose:{.[y;(1;x);:;y 1]} part:{y[1;&x 0>y 1]} frame:{part[~:]x} dimension:#frame@ order:{part[::]x} valence:#order@ shape:{x 1} count:*shape@ rank:#shape@ sh:{dsh[x]min fsh x} dsh:{((- 1+~#y)_^x),y} fsh:{:[7=4:*x;1_-!1+*|x;_f'x]} min:{:[4:x;x;1=#?^:'x;{(&/#:'x)#*x}@_f'x;!0]} array:{(x;sh x)} flip:{:[~1<#s:shape x;x;(:[1<#f:frame x;((|2#f),2_ f)#raze@*x;*x];(|2#s),2_ s)]} raze:{:[7=4:*x;,x;,/_f'x]} reverse:{} enlist:{} first:{} rotate:{} take:{} drop:{} join:{} conform:{:[0f;2,s;,2]} same:{((x=m#y)?0)#x:(m:(#x)&#y)#x} a:((+;2);(-;2)) :b:array((a;a;a);(a;a;a)) :c:flip b sh@*c \ sh(a;(a;a)) \ / commute apply[flip array[-]2]3 7 f:{x+y%z} g:{x#!0|y+z} a:array[(f;g)]3 b:reverse a c:flip reverse a d:reverse each[flip]a e:first a apply[;5 7 -3]'(a;b;c;d;e) take[3]a take[-1]a take[3]array[-]2 drop[1]a drop[-1]a drop[2]a take[0]a count a count array[-]2 / list-rank>1 h:((f;g);2 -1 3 -2 -3) apply[h;5 7 -3] / nested aa:array[(a;a)]3 apply[aa;3 4 5] apply[each[flip]aa]3 4 5 apply[@[aa;0;each[flip]']]3 4 5 / short shape k:array[({x+y*z};-)]2 apply[k;2 3] / multidimensional apply[take[3 4]array[-]2;3 4] / join join[a]b join[a]a / empty first array[();0]