datatype list =
  | nil of ()
  | {x:int | (x mod 2) == 0 } cons of (int x, list)

fun print_list(xs: list): void = 
  case+ xs of
  | nil () => print_newline()
  | cons(x, xs) => begin printf("%d ", @(x)); print_list(xs) end

implement main() = let
  val a = cons(2, cons(4, cons(10, cons(6, nil))))
  val () = print_list(a)
in
  ()
end