coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Venanzio Capretta <venanzio AT site.uottawa.ca>
- To: vincent.chatel AT transport.alstom.com
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] prod list
- Date: Thu, 06 Oct 2005 11:47:49 -0400
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
You can do this:
-----------------------------------------------------
Inductive poly_list: Type :=
poly_nil: poly_list
| poly_cons: forall X:Set, X -> poly_list -> poly_list.
Implicit Arguments poly_cons [X].
Check (poly_cons true (poly_cons 3 poly_nil)).
------------------------------------------------------
In the good old days when Set was impredicative you could have defined
it in Set instead of Types.
Cheers,
Venanzio
On Thu, 2005-06-10 at 17:11 +0200,
vincent.chatel AT transport.alstom.com
wrote:
> Hi Coq'ers,
>
> I would like to construct an inductive type like prod but such that all
> elements of this type finish by a final element.
>
> ( ) : 1
> (a,( )) : A * 1 (it's isomorph to A)
> (b,a,( )) : B *A *1
> ...
>
> It seems like a list but in a list I cannot mix elements with differents
> types.
>
> Thaks in advance
>
> Vincent
- [Coq-Club] prod list, vincent . chatel
- Re: [Coq-Club] prod list, Venanzio Capretta
- Re: [Coq-Club] prod list, Roland Zumkeller
Archive powered by MhonArc 2.6.16.