def pop

bend-collections-laws-math@1.0.0.0 · src/math/random/chacha8.bend:68

import bend-collections-laws-math@1.0.0.0/src/math/random/chacha8.bend as Chacha8
import Base
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W

68def pop(g: ChaCha8) -> W.U64 & ChaCha8:
69  match g:
70    case C{k, p, buf}:
71      match buf:
72        case Con{x, rest}:
73          (x, C{k, p, rest})
74        case Nil{}:
75          (zero(), C{k, p, []})

Uses (6)

Used by (2)