def bits_add

bend-collections@1.0.0.0 · src/containers/bitlist.bend:231

import bend-collections@1.0.0.0/src/containers/bitlist.bend as Bitlist
import Base
import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as D
import bend-collections@1.0.0.0/src/containers/types/dynamic_array.bend as DE

231# Word q holds bits 32q .. 32q+31; of the first n bits it contributes
232# min(32, n - 32q) (none once 32q >= n).
233def bits_add(+m: Nat, acc: List<&2, Bool>, g: D.DynArray<&2, U32> & Result<&2, &2, DE.Error, U32>) -> D.DynArray<&2, U32> & List<&2, Bool>:
234  match g:
235    case Tuple{w, Done{+x}}:
236      (w, word_bits(m, x, acc))
237    case Tuple{w, Fail{e}}:
238      (w, acc)

Uses (10)

Used by (1)