-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
We have a large AST definition made of many node types and we'd like to derive two different sets of equality functions:
- one using structural equality, ignoring node IDs
- one using only the node IDs
Our code looks like this:
type stmt = {
id : int [@deriving equal fun _ _ -> true]; (* ignore if generated function prefix is "equal_" *)
value : stmt_value [@deriving equal2 fun _ _ -> true]; (* ignore if prefix is "equal2_" *)
}
and stmt_value = ...
and expr = ...
...
[@@deriving eq, eq2] (* "eq2" is hypothetical, generates functions with prefix "equal2_" *)We want one set of functions with the equal_ prefix and another set with the equal2_ prefix (or better, a custom name).
Is there currently a way to do such thing? Any suggestion on how to make this work?
Metadata
Metadata
Assignees
Labels
No labels