Flatten

Run Settings
LanguageRaku
Language Version
Run Command
multi flatten(@array ($first, *@rest)) { if @array.empty { return []; } elsif $first.empty { flatten(@rest); } else { $first ++ flatten(@rest) } } //def flatten([list|tail]) when is_list(list), do: flatten(list) ++ flatten(tail) //def flatten([elm|tail]), do: [elm] ++ flatten(tail) //def flatten([nil|tail]), do: flatten(tail) //def flatten([]), do: []
Editor Settings
Theme
Key bindings
Full width
Lines