Barb (⥊)

⥊ 𝕩: Deshape

→full documentation

Put all elements of 𝕩 in a rank 1 array, promoting to an array if necessary.

↗️
    ⥊ 1
⟨ 1 ⟩

    ⥊ 1‿2 ≍ 3‿4
⟨ 1 2 3 4 ⟩

𝕨 ⥊ 𝕩: Reshape

→full documentation

Put all elements of 𝕩 in an array of shape 𝕨, removing elements or repeating them cyclically if necessary.

A single element in 𝕩 can be a function, which will be replaced with an appropriate length:

↗️
    3‿3 ⥊ 3
┌─       
╵ 3 3 3  
  3 3 3  
  3 3 3  
        ┘

    2‿⌽‿2 ⥊ 1‿2‿3
┌─     
╎ 1 2  
       
  3 1  
      ┘

    2‿↑‿2 ⥊ 1‿2‿3
┌─     
╎ 1 2  
       
  3 0  
      ┘