`tc_to_bool` to turn a type class into a Boolean that expresses if there is an instance
This MR introduces the following function:
(** Given a proposition [P] that is a type class, [bool_of_tc P] will return
[true] iff there is an instance of [P]. *)
Definition bool_of_tc (P : Prop)
{p : bool} `{TCIf P (TCEq p true) (TCEq p false)} : bool := p.
It's particularly useful in Ltac, where it's sometimes needed to figure out if an instance exists or not. An example use can be found in https://gitlab.mpi-sws.org/FP/iris-coq/merge_requests/199
Edited by Robbert Krebbers
Merge request reports
Activity
Filter activity
added 1 commit
- 512b3f99 - `tc_to_bool P` to turn a type class into a Boolean that represents if there is an instance.
mentioned in commit 48758ab8
mentioned in merge request !45 (merged)
Please register or sign in to reply