coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Daniel Schepler <dschepler AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] Typeclasses and implicit arguments
- Date: Thu, 10 Mar 2011 10:14:04 -0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=GcJAb9LR2eN5ZHxLpqAEOMU7yrWLPb1CIzzBOvCKJgBI4lmPblauTL7/p7jZ52JtdD BgF+VnyZzToKUNLFWdfstt7mNmpK52O733LrYis6a7iigXyNgoAsE2yMV2qRkTuVMuNY anCpaHY0XQV75CmuCa/tuR8F3ZYs97cMCa740=
Let me add my own question on typeclasses:
Suppose I define
Generalizable All Variables.
Class ExtEqual {X Y} (f g:X->Y) : Prop :=
extensional_equality : forall x:X, f x = g x.
Class injective `(f:X->Y) : Prop :=
injectivity: forall x1 x2:X, f x1 = f x2 -> x1 = x2.
Instance injective_properness
`{ExtEqual X Y f g} `{injective _ _ f} :
injective g.
Here why do I have to fill in the implicit arguments for ExtEqual and
injective? Is that the intended behavior?
Also, it seems if I add too many instances along these lines (fg injective ->
g injective, id injective and surjective, etc.) I tend to end up with the
resolver failing in simple situations, and "typeclasses eauto" looping.
--
Daniel Schepler
- [Coq-Club] Typeclasses and implicit arguments, Daniel Schepler
- Re: [Coq-Club] Typeclasses and implicit arguments,
Tom Prince
- Re: [Coq-Club] Typeclasses and implicit arguments, Matthieu Sozeau
- Re: [Coq-Club] Typeclasses and implicit arguments,
Tom Prince
Archive powered by MhonArc 2.6.16.