Commit 512b3f99 authored by Robbert Krebbers's avatar Robbert Krebbers

`tc_to_bool P` to turn a type class into a Boolean that represents if there is an instance.

parent e2a239e2
......@@ -145,6 +145,12 @@ Inductive TCDiag {A} (C : A → Prop) : A → A → Prop :=
Existing Class TCDiag.
Existing Instance TCDiag_diag.
(** Given a proposition [P] that is a type class, [tc_to_bool P] will return
[true] iff there is an instance of [P]. It is often useful in Ltac programming,
where one can do [lazymatch tc_to_bool P with true => .. | false => .. end]. *)
Definition tc_to_bool (P : Prop)
{p : bool} `{TCIf P (TCEq p true) (TCEq p false)} : bool := p.
(** Throughout this development we use [stdpp_scope] for all general purpose
notations that do not belong to a more specific scope. *)
Delimit Scope stdpp_scope with stdpp.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment