coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Nikhil Swamy <nswamy AT microsoft.com>
- To: Adam Chlipala <adam AT chlipala.net>
- Cc: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: RE: [Coq-Club] Equality-witnessing coercions?
- Date: Tue, 9 Nov 2010 23:39:35 +0000
- Accept-language: en-US
> > Say I want to write this function (using the same definitions of A, B and
> > foo
> as below):
> >
> > Definition bar (a:A) (b:B a) : (B a * unit) :=
> > (b, match a with
> > | One => foo b
> > | Two => tt
> > end).
> >
>
> An instance of what I call the convoy pattern in CPDT gives us this version:
>
> Definition bar (a:A) (b:B a) : (B a * unit) :=
> (b, match a return B a -> _ with
> | One => foo
> | Two => fun _ => tt
> end b).
>
Very cool! This does what I want, I think. Thanks much ... I really should
read your book! : )
-Nik
- [Coq-Club] Equality-witnessing coercions?, Nikhil Swamy
- Re: [Coq-Club] Equality-witnessing coercions?,
Adam Chlipala
- RE: [Coq-Club] Equality-witnessing coercions?,
Nikhil Swamy
- Re: [Coq-Club] Equality-witnessing coercions?,
Adam Chlipala
- RE: [Coq-Club] Equality-witnessing coercions?, Nikhil Swamy
- Re: [Coq-Club] Equality-witnessing coercions?,
Adam Chlipala
- RE: [Coq-Club] Equality-witnessing coercions?,
Nikhil Swamy
- <Possible follow-ups>
- Re: [Coq-Club] Equality-witnessing coercions?, Guillaume Melquiond
- Re: [Coq-Club] Equality-witnessing coercions?,
Adam Chlipala
Archive powered by MhonArc 2.6.16.