Local definitions

Local definitions are introduced with the let construct.

sum : NList -> Nat;
sum lst :=
    go : Nat -> NList -> Nat;
    go acc nnil := acc;
    go acc (ncons x xs) := go (acc + x) xs;
  go 0 lst;

The declaractions in a let have the same syntax as declarations inside a module, but they are visible only in the expression following the in keyword.