Definition unary_primop (f:nat -> nat) : expr :=
  Lam (prim (v_Nat oo f) (Var 0)).Program Definition bin_primop (f:nat -> nat -> nat) : expr :=
  Lam (prim (fun n1 => Lam (prim (fun n2 => v_Nat (f n1 n2)) (Var 0))) (Var 0)).

Lemma binary_primop_typ : forall (f:nat -> nat -> nat), Typ nil (bin_primop f) (ty_lam ty_nat (ty_lam ty_nat ty_nat)).