def split
import bend-lawful-stdlib@0.1.0.0/src/float/f32.bend as F32import Base
41# a word's first n bits, and its last bit (the sign, for n = 31)
42def split(n: Nat, w: Word(1n+n)) -> Word(n) & Bool:
43 match n:
44 case 0n:
45 match w:
46 case WCon{b, t}:
47 (WNil{}, b)
48 case 1n+p:
49 match w:
50 case WCon{b, t}:
51 split.cons(p, b, split(p, t))