ABAA/ABBB: Generate this recursive 2D pattern
APL (Dyalog Classic), 29 25 bytes



'|-'[{a,⊖⌽⍉~a←⍪⍨⍵}⍣⎕⍉⍪⍳2]


Try it online!

⍳2 is the vector 0 1

⍪ turns it into a 2x1 matrix

⍉ transposes it, so it becomes 1x2

⎕ evaluated input

{ }⍣⎕ apply a function that many times

⍪⍨⍵ concatenate the argument on top of itself - a 2x2 matrix

a← remember as a

~ negate

⍉ transpose

⌽ reverse horizontally

⊖ reverse vertically

a, concatenate with a on the left

'|-'[ ] use the matrix as indices in the string '|-', i.e. turn 0 into | and 1 into -