public function flatMap(callable $func) : array
    {
        $list = $this->list;
        $acc = [];

        foreach ($list as $val) {
            $acc[] = $func($val);
        }

        return $acc;
    }
public function flatMap(callable $func) : array
    {
        $list = $this->list;
        $acc = [];

        foreach ($list as $val) {
            $acc[] = $func($val);
        }

        return $acc;
    }
public function flatMap ( callable $ func ) : array { $ list = $ this -> list ; $ acc = [ ] ; foreach ( $ list as $ val ) { $ acc [ ] = $ func ( $ val ) ; } return $ acc ; }
flatMap method.

@method flatMap

@param callable $func

@return array $flattened
flatMap method .