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: Gregory Malecha <gmalecha AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Coercions and Defined Types
  • Date: Fri, 2 Oct 2015 10:32:46 -0700
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-yk0-f180.google.com
  • Ironport-phdr: 9a23:bZ2BGxWmEePEJOS5H84G23ExWzrV8LGtZVwlr6E/grcLSJyIuqrYZhOFt8tkgFKBZ4jH8fUM07OQ6PC8HzJcqs/Z7DgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2PJVsUz2PlPftbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN4xxd7FTDSwnPmYp/4Wr8ECbFUrcrkcbB04Ri1JjBxXPpEXxWY60uS/nvMJ83jObNIv4V+Zndy6l6vJEUhLnjz0Wfxsw9GzcisU42K1eqRasrBx264HRaYCRcvF5e/WOLpshWWNdU5MJBGR6CYSmYt5KVrJZMA==

Hi, Jason --

Thanks for the pointer. I think it would have worked, except my example a little bit more simplified since [a] and [b] need associated type class instances. So the type of [onEach] is really [forall a b, X a -> Y b -> foo a b -> bar a b]. Coq reports that this does not respect the uniform inheritence condition, which is in line with what is written in the manual.

On Thu, Oct 1, 2015 at 4:12 PM, Jason Gross <jasongross9 AT gmail.com> wrote:

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



--
gregory malecha



Archive powered by MHonArc 2.6.18.

Top of Page