I have defined the type of a polymorphic list and its constructors, and now trying to write a fonction that concatenate 2 lists but my function concat does not work
Definition listA A :Set :=
forall T :Set, T -> (A -> T -> T) -> T.
Definition pnil (A :Set) : listA A :=
fun T: Set => fun (x : T ) => fun (c : A -> T -> T) => x.
Definition pcons (A :Set): A -> (listA A) -> (listA A):=
fun (a : A) (q : listA A) => fun T : Set => fun (x : T ) => fun (c : A -> T -> T) => c a (q T x c).
Definition concat (A :Set ) (a b:listA A): listA A :=
a A b ( pcons A a b).
error I get for the function concat
In environment
A : Set
a : listeA A
b : listeA A
The term "b" has type "listeA A" while it is expected to have type "A".