Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Coercions and Defined Types

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Coercions and Defined Types


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Coercions and Defined Types
  • Date: Thu, 1 Oct 2015 19:12:44 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-ob0-f172.google.com
  • Ironport-phdr: 9a23:doGq3Bb9v3Wd25siftFOPdr/LSx+4OfEezUN459isYplN5qZpci9bnLW6fgltlLVR4KTs6sC0LqK9f67EjZaqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7z0pcaYOV8ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kq8/VPlTCCksezQ+49Suvh3eRyOO4GEdWyMYiEwbLRLC6UTYV4z2tGPVrO1mw2HOP8TtSrY7QzO59PZDRxrhiSNBPDk8pjKEwvdshb5W9Ury7yd0xJTZNdmY

As a kludge, stick the definitions in a module, their types in a module type, declare the coercion in a functor, and then import the applied functor?

-Jason

On Oct 1, 2015 6:54 PM, "Gregory Malecha" <gmalecha AT gmail.com> wrote:
Hello --

I have some types (similar to):

Definition foo a b  := list a -> b.
Definition bar a b := a -> b.

and I have a function to transport [foo]s into [bar]s.

Definition onEach : forall a b, foo a b -> bar a b.

I want to declare [onEach] as a coercion:

Coercion onEach : foo >-> bar.

but I get

Error: Found target class bar instead of Funclass.

Is there some way to tell Coq that it should treat [bar] as opaque? I know that I can make [bar] a record type, but I don't really want to pack and unpack functions all the time.

Thanks.

--
gregory malecha



Archive powered by MHonArc 2.6.18.

Top of Page