def cons_some
import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as DynamicArrayimport Base
193# to_list walks the occupied slots BY INDEX, newest first, and conses them:
194# the walk gives the array back, so nothing is cloned, and a `Base.Array` is
195# never matched structurally (that destroys the flat representation, see
196# docs/VALIDATION.md).
197def cons_some(-T: Data, x: Maybe<&2, T>, acc: List<&2, T>) -> List<&2, T>:
198 match x:
199 case None{}:
200 acc
201 case Some{v}:
202 Con{v, acc}