def Int.ext
import bend-kit-int@0.2.0.0/int.bend as Intimport Base
45def Int.ext(m: Nat, n: Nat, +fill: Bool, w: Word(n)) -> Word(m):
46 match m:
47 case 0n:
48 WNil{}
49 case 1n+p:
50 match n:
51 case 0n:
52 WCon{fill, Int.ext(p, 0n, fill, WNil{})}
53 case 1n+q:
54 match w:
55 case WCon{b, t}:
56 WCon{b, Int.ext(p, q, fill, t)}