Replies: 5 comments
-
Hello, this sounds interesting, but I don't see the full picture. Could you give some sort of specification of the feature (independent of the implementation)? A minimal example would be great as well. |
Beta Was this translation helpful? Give feedback.
-
The application I have in mind would be to infer the sql type from ocaml type in some data base interface I am currently writing. It would be a bit long to describe. More generally, when writing a ppx I am always thinking "how is would be nice if I would knew the type of x" or more often "I need to know the signature of this module". This proposal would allow to do that. I have another nice minimal example. Consider an extension f[%poly Default] always applied to an identifier.
I think we could change the interpretation of Remark: the above example could probably be used to add lists or arrays if modules like I think this is quite controlable (nothing happens as long as the needed module are not in the environment). So your + symbol |
Beta Was this translation helpful? Give feedback.
-
It might be worth checking out @EduardoRFS's typed-ppxlib: https://github.com/EduardoRFS/typedppxlib for something like this. It exposes type checker internals, but would definitely get the job done for your application. |
Beta Was this translation helpful? Give feedback.
-
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Beta Was this translation helpful? Give feedback.
-
Since the feature wish failed to gather interests, I have converted it to a discussion to remove it from the list of issues, while keeping the discussion open. |
Beta Was this translation helpful? Give feedback.
-
I propose a new kind of ppx extension where the type would be known. The idea is as follows:
of the expression/module at type-checking
This typed AST is thrown away. This first stage is run only if ppx extension that needs type information are registered.
access to type, module type and class type definitions that appear in the infered type for the node.
This seems
Beta Was this translation helpful? Give feedback.
All reactions