def encode

stelliferous@0.0.2.0 · proofs/word_arithmetic.bend:53

import stelliferous@0.0.2.0/proofs/word_arithmetic.bend as WordArithmetic
import Base

53def encode(a: Nat,+width: Nat) -> Word(width):
54  match a:
55    case 0n:
56      Word.zero(width)
57    case 1n+p:
58      Word.inc(width,encode(p,width))

Uses (4)

Used by (11)