union slot = | None | Held : (heap {value : (heap {value : i32 * string}) * i32}) let score x : i32 = match x with | None => 1i32 | Held box => inl opened = !!!!LayoutIndex(box) inl ~(cell, count) = opened.value inl inner_opened = !!!!LayoutIndex(cell) inl ~(left, right) = inner_opened.value if left =. 7i32 && !!!!EQ(right, "hi") && count =. 1i32 then 0i32 else 1i32 inl main () : i32 = inl ~n = 7i32 inl ~word = "hi" inl inner_pair = n, word inl inner = !!!!LayoutToHeap({value = inner_pair}) inl ~extra = 1i32 inl outer_pair = inner, extra inl outer = !!!!LayoutToHeap({value = outer_pair}) inl f (z : i32) : slot = if z =. 0i32 then None else Held outer inl ~g = f score (g 1i32)