Added parameter types to lambda examples

Also corrected one minor error, where $i was being used to refer to a
variable that was actually called $x.