Ltac2 local env APIs#21654
Conversation
5d25632 to
52d367c
Compare
52d367c to
73325e3
Compare
73325e3 to
e09aa88
Compare
|
Should these new APIs be documented in the Ltac2 chapter or are they too internal? |
|
@cpitclaudel to me its part of the corelib for Ltac2, it does not need any further documentation. One can write a tutorial or how-to for Platform Docs, if the they want to discuss how to use them |
f071bf4 to
fe3a440
Compare
|
changed to use result instead of backtracking exceptions |
| Ltac2 @external eval_in_env : env -> Std.Red.t -> constr -> constr | ||
| := "rocq-runtime.plugins.ltac2" "reduce_constr_in_env". |
There was a problem hiding this comment.
Shouldn't we route Ltac2 eval through this function?
There was a problem hiding this comment.
what are you calling Ltac2 eval?
| Ltac2 Type t := sort. | ||
|
|
||
| (** [sort_of_product s s'] is [s''] such that if [A : s] and [B : s'] then [A -> B : s'']. *) | ||
| Ltac2 @external sort_of_product : t -> t -> t |
There was a problem hiding this comment.
Are we sure we want Sort.sort_of_product rather than Sort.of_product?
|
|
||
| Module UnsafeEnv. | ||
| (** Print the given term in the given environment (does not print the environment). *) | ||
| Ltac2 @external message_of_constr_in_env : env -> constr -> message |
There was a problem hiding this comment.
This should presumably be of_constr_in_env to match with all of the other names here. And plausibly we should route of_constr through this function
| (** Early declaration, see [Relevance.UnsafeEnv]. *) | ||
| Local Ltac2 @external relevance_of_type_in_env : env -> constr -> relevance | ||
| := "rocq-runtime.plugins.ltac2" "relevance_of_type_in_env". | ||
|
|
There was a problem hiding this comment.
Can't we just move Module Relevance up and do Ltac2 Type relevance := Relevance.t instead of the other way around
There was a problem hiding this comment.
we have Ltac2 Import Type so we could use that to avoid breaking references to Binder.Relevant
not sure I want to do it in this PR
Co-authored-by: Jason Gross <jasongross9@gmail.com>
Return of #20206, now with unsafe APIs marked unsafe