partition←{
fixSpec←{ ⍝ Fix the left argument to comply with the task specification
⍝ ⍺ is spec, ⍵ is ⍴⍴arr
0=≡⍺:(,⍺)(,1)(⍵⍴1) ⍝ simple scalar → shape = ,⍺, default spec & start
1=≡⍺:(⍺)(1⍴⍨⍴⍺)(⍵⍴1) ⍝ simple vector → shape = ⍺, default spec & start
1=≢⍺:(⊃⍺)(1⍴⍨⍴⊃⍺)(⍵⍴1) ⍝ 1-element box vector → shape = ⊃⍺, default spec & shape
2=≢⍺:⍺,⊂⍵⍴1 ⍝ 2-element box vector → shape = 1⌷⍺, spec = 2⌷⍺, default shape