def unpack

lawful-bytes@0.1.1.0 · defs.bend:14

import lawful-bytes@0.1.1.0/defs.bend as Defs
import Base
import lawful-words@0.1.0.0/defs.bend as W

14# The four bytes of each word, in order.
15def unpack(ws: List<&2, U32>) -> List<&2, U32>:
16  match ws:
17    case Nil{}:
18      Nil{}
19    case Con{+w, t}:
20      List.append(&2, U32, [W.byte(w, 0n), W.byte(w, 1n), W.byte(w, 2n), W.byte(w, 3n)], unpack(t))

Uses (4)

Used by (29)