ROSCOQ.CoList


Set Implicit Arguments.

CoInductive CoList (A : Type) : Type :=
    cnil : CoList A | ccons : ACoList ACoList A.

Fixpoint initialSegment {A} (len : nat) (cl : CoList A) : list A :=
match len with
| 0 ⇒ nil
| S len'match cl with
         | cnilnil
         | ccons hd tlcons hd (initialSegment len' tl)
         end
end.