foo : (x : Nat) -> case x of Z => Nat -> Nat S k => Nat