def take1

bend-collections@1.0.0.0 · src/crypto/random.bend:111

import bend-collections@1.0.0.0/src/crypto/random.bend as Random
import Base
import bend-collections@1.0.0.0/src/math/random/chacha8.bend as C8

111# one byte: the next pending byte, or the first byte of a fresh word
112def take1(f: Fill) -> Fill:
113  match f:
114    case FS{acc, c, p}:
115      match p:
116        case Con{b, rest}:
117          FS{Con{b, acc}, c, rest}
118        case Nil{}:
119          split(acc, C8.next(c))

Uses (4)

Used by (1)