def step
bend-collections@1.0.0.0 · src/containers/internal/dlist_storage.bend:482
import bend-collections@1.0.0.0/src/containers/internal/dlist_storage.bend as DlistStorage
import Base
import bend-collections@1.0.0.0/src/containers/types/internal_dlist.bend as E
482def step(~T: Data, s: DList<T>, op: E.Op<T>) -> DList<T> & E.Obs<T>:
483 match op:
484 case E.Length{}:
485 obs_nat(~T, length(~T, s))
486 case E.PushFront{x}:
487 obs_handle(~T, push_front(~T, s, x))
488 case E.PushBack{x}:
489 obs_handle(~T, push_back(~T, s, x))
490 case E.InsertBefore{h, x}:
491 obs_insert(~T, insert_before(~T, s, h, x))
492 case E.InsertAfter{h, x}:
493 obs_insert(~T, insert_after(~T, s, h, x))
494 case E.Remove{h}:
495 obs_val(~T, remove(~T, s, h))
496 case E.Get{h}:
497 obs_val(~T, get(~T, s, h))
498 case E.Set{h, x}:
499 obs_unit(~T, set(~T, s, h, x))
500 case E.Next{h}:
501 obs_nbr(~T, next(~T, s, h))
502 case E.Prev{h}:
503 obs_nbr(~T, prev(~T, s, h))
504 case E.ToList{}:
505 obs_list(~T, to_list(~T, s))