summaryrefslogtreecommitdiff
path: root/theories/Classes/Init.v
blob: e5f951d094f070b933e1eaa140edec518531d355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(* Initialization code for typeclasses, setting up the default tactic 
   for instance search.

   Author: Matthieu Sozeau
   Institution: LRI, CNRS UMR 8623 - UniversitÃcopyright Paris Sud
   91405 Orsay, France *)

(* $Id: Init.v 11282 2008-07-28 11:51:53Z msozeau $ *)

(* Ltac typeclass_instantiation := typeclasses eauto || eauto. *)

Tactic Notation "clapply" ident(c) :=
  eapply @c ; eauto with typeclass_instances.

(** The unconvertible typeclass, to test that two objects of the same type are 
   actually different. *)

Class Unconvertible (A : Type) (a b : A).

Ltac unconvertible :=
  match goal with
    | |- @Unconvertible _ ?x ?y => conv x y ; fail 1 "Convertible"
    | |- _ => apply Build_Unconvertible 
  end.

Hint Extern 0 (@Unconvertible _ _ _) => unconvertible : typeclass_instances.