P14 - Duplicate the elements of a list.

Author: Johan Viklund

Specification

P14 (*) Duplicate the elements of a list.

Example

> say ~dupli();
a a b b c c c c d d

Source code: P14-viklund.pl

use v6;

say .map({ $_ xx 2 }).map({.list}).flat.list.perl;