syntax: implement in-place folding of P<T> and Vec<T>.