diff options
| author | Pierre-Marie Pédrot | 2020-11-17 19:06:34 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-11-17 19:06:34 +0100 |
| commit | 7c79a0da543536da48cd49cb9b09682fb9a6efe8 (patch) | |
| tree | f7b6a3c08b0c86ced67793bb9e600bd254f3096a /kernel/context.ml | |
| parent | f1b7a377473919327a270090090d774b678f6628 (diff) | |
| parent | 05cf3fca1d0800e4cefaed3cb1825a8420ce9f2c (diff) | |
Merge PR #13397: Adding heterogeneous map on named contexts.
Reviewed-by: ppedrot
Diffstat (limited to 'kernel/context.ml')
| -rw-r--r-- | kernel/context.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/context.ml b/kernel/context.ml index 6a99f201f3..ab66898b59 100644 --- a/kernel/context.ml +++ b/kernel/context.ml @@ -365,6 +365,15 @@ struct let ty' = f ty in if v == v' && ty == ty' then decl else LocalDef (id, v', ty') + let map_constr_het f = function + | LocalAssum (id, ty) -> + let ty' = f ty in + LocalAssum (id, ty') + | LocalDef (id, v, ty) -> + let v' = f v in + let ty' = f ty in + LocalDef (id, v', ty') + (** Perform a given action on all terms in a given declaration. *) let iter_constr f = function | LocalAssum (_, ty) -> f ty |
