Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a general Show typeclass in MetaCoq.Utils #1063

Merged
merged 2 commits into from Feb 29, 2024
Merged

Conversation

mattam82
Copy link
Member

This allows to conveniently print anything for debugging purposes, or using the FFIs to print messages in the various extractions (the live and extracted ones, malfunction or certicoq)

@mattam82 mattam82 merged commit 2cbbd67 into coq-8.17 Feb 29, 2024
10 checks passed
@mattam82 mattam82 deleted the show-typeclass branch February 29, 2024 08:32
@JasonGross
Copy link
Contributor

If you want a version that does levels-based parenthesizing, Fiat Crypto has such a class: https://github.com/mit-plv/fiat-crypto/blob/master/src/Util/Strings/Show.v

@gmalecha
Copy link
Contributor

gmalecha commented Mar 1, 2024

ExtLib has a Show class and instances as well. Is there any interest in unifying things like this? Would people depend on another opam library to get Show with a bunch of instances for standard types, e.g. bool, nat, N, etc?

@JasonGross
Copy link
Contributor

JasonGross commented Mar 8, 2024

Does ExtLib do level-based printing, so that it can parenthesize as much as needed but not more?

In any case, it seems in #952 (comment) that we're receptive to depending on extlib

@gmalecha
Copy link
Contributor

gmalecha commented Mar 10, 2024

ExtLib does not do level based printing that I am aware of. The underlying setup is parameterized by a Monoid with an injection from Ascii I think. You could add a wrapper for a level though to get this extra functionality.

My main motivation is to avoid repeated work, if you benefit from this, other might as well and that would make for reducing overall maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants