def Int.ext

bend-kit-int@0.2.0.0 · int.bend:45

import bend-kit-int@0.2.0.0/int.bend as Int
import 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)}

Uses (5)

Used by (4)