Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Equality-witnessing coercions?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Equality-witnessing coercions?


chronological Thread 
  • From: Adam Chlipala <adam AT chlipala.net>
  • To: Nikhil Swamy <nswamy AT microsoft.com>
  • Cc: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Equality-witnessing coercions?
  • Date: Tue, 09 Nov 2010 17:58:36 -0500

Nikhil Swamy wrote:
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).




Archive powered by MhonArc 2.6.16.

Top of Page