def move_meta
import bend-collections@1.0.0.0/src/containers/dlist_iterator.bend as DlistIteratorimport Base
100def move_meta(~T: Data, n: U32, last: U32, f: Bool, +i: Nat, h: U32, next: U32, +forward: Bool, r: Result<&2, &2, Error, T>) -> Move<T>:
101 match r:
102 case Fail{e}:
103 M{n, last, f, i, Fail{e}}
104 case Done{x}:
105 M{next, h, forward, choose(Nat, forward, 1n+i, Nat.sub(i, 1n)), Done{x}}