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

Expose implementation? #106

Open
patricoferris opened this issue Aug 28, 2023 · 0 comments
Open

Expose implementation? #106

patricoferris opened this issue Aug 28, 2023 · 0 comments

Comments

@patricoferris
Copy link
Contributor

Currently, the implementation of a runtime type value ('a t) is abstract to any library that uses repr. From the perspective of repr this is nice because it allows the authors to freely change the implementation with hopefully very little downstream impact and most users are probably happy with the set of features provided by repr.

However, for anybody wishing to extend repr this is not possible as they cannot look at the implementation to manipulate it. I've hit this a few times. First when prototyping an automatic diffing library (I ended up prototyping with typegist instead https://github.com/patricoferris/patch) and more recently when thinking of doing some SQL generation for types. Perhaps I'm missing something in the API that would let me extend repr in a separate library? If not, would there be interest in providing this feature? Even something like:

val to_type_core : 'a t -> 'a Type_core.t
val of_type_core : 'a Type_core.t -> 'a t

Thanks! :))

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

No branches or pull requests

1 participant