Program Definition stream_capp {A: Type} (h: nat -> stream A): stream A :=
  fun n: nat =>
    match partial_stream_clen' h n return option A with
    | Some (k, m) => h k m
    | None => None
    end.

Lemma stream_capp_spec1 {A: Type}: forall (h: nat -> stream A) (m: nat), is_at_least_n_stream (S m) (h 0) -> stream_capp h m = h 0 m.