def Gf8Bits.horner
import bend-osdev-gf@0.1.1.0/gf.bend as Gfimport Base
88# Horner's rule over the bits ts, most significant first
89def Gf8Bits.horner(ts: List<&2, Bool>, acc: Gf8Bits, +b: Gf8Bits, +p: Gf8Bits) -> Gf8Bits:
90 match ts:
91 case Nil{}:
92 acc
93 case Con{t, rest}:
94 Gf8Bits.horner(rest, Gf8Bits.step(t, acc, b, p), b, p)