RFCs icon indicating copy to clipboard operation
RFCs copied to clipboard

Primitive aliases

Open nmatschke opened this issue 1 year ago • 4 comments

This is a proposal for extending the syntax for external primitives, making it easier to re-bind them under a different identifier, without reiterating the entire description (type, attributes, and symbols).

Rendered version

(Thanks to @goldfirere for reviewing this RFC)

nmatschke avatar Jul 15 '24 16:07 nmatschke

This seems useful and, from a distance, seems to be a straightforward change: as long as we have the info that a signature item is a primitive, I don’t see any obstacle to typechecking aliases of it.

OlivierNicole avatar Jul 23 '24 12:07 OlivierNicole

From a distance, this looks like a nice proposal that allows avoiding the error-prone duplication of external declarations. In favor!

nojb avatar Jul 23 '24 19:07 nojb

Thanks for the review so far. I have implemented this and opened PR #13377 against the main OCaml repo.

nmatschke avatar Aug 13 '24 22:08 nmatschke

Have you also considered extending the signature constraint mechanism S with external t = "foo" ? From a distance (I've never used externals), it seems like use-cases for this would appear with your extension ? I can help on that topic if needed.

clementblaudeau avatar Jul 04 '25 08:07 clementblaudeau