def take1
import bend-collections-laws-crypto@1.0.0.0/src/crypto/random.bend as Randomimport Base
import bend-collections-laws-crypto@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))