def unpairs

bendtorch@1.3.0.0 · dtype.bend:151

import bendtorch@1.3.0.0/dtype.bend as Dtype
import Base

151# every value of a list of pairs, in order
152def unpairs(ws: List<&2, HW>) -> List<&2, U32>:
153  match ws:
154    case Nil{}:
155      Nil{}
156    case Con{HW{a, b}, t}:
157      a <> (b <> unpairs(t))

Uses (3)

Used by (2)