aboutsummaryrefslogtreecommitdiff
path: root/interp/notation_ops.mli
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2017-08-29 19:05:57 +0200
committerPierre-Marie Pédrot2017-09-04 11:28:49 +0200
commit1db568d3dc88d538f975377bb4d8d3eecd87872c (patch)
treed8e35952cc8f6111875e664d8884dc2c7f908206 /interp/notation_ops.mli
parent3072bd9d080984833f5eb007bf15c6e9305619e3 (diff)
Making detyping potentially lazy.
The internal detype function takes an additional arguments dictating whether it should be eager or lazy. We introduce a new type of delayed `DAst.t` AST nodes and use it for `glob_constr`. Such type, instead of only containing a value, it can contain a lazy computation too. We use a GADT to discriminate between both uses statically, so that no delayed terms ever happen to be marshalled (which would raise anomalies). We also fix a regression in the test-suite: Mixing laziness and effects is a well-known hell. Here, an exception that was raised for mere control purpose was delayed and raised at a later time as an anomaly. We make the offending function eager.
Diffstat (limited to 'interp/notation_ops.mli')
-rw-r--r--interp/notation_ops.mli18
1 files changed, 9 insertions, 9 deletions
diff --git a/interp/notation_ops.mli b/interp/notation_ops.mli
index 3154fd7adb..0904a4ea3e 100644
--- a/interp/notation_ops.mli
+++ b/interp/notation_ops.mli
@@ -47,19 +47,19 @@ val glob_constr_of_notation_constr : ?loc:Loc.t -> notation_constr -> glob_const
exception No_match
-val match_notation_constr : bool -> glob_constr -> interpretation ->
- (glob_constr * subscopes) list * (glob_constr list * subscopes) list *
- (extended_glob_local_binder list * subscopes) list
+val match_notation_constr : bool -> 'a glob_constr_g -> interpretation ->
+ ('a glob_constr_g * subscopes) list * ('a glob_constr_g list * subscopes) list *
+ ('a extended_glob_local_binder_g list * subscopes) list
val match_notation_constr_cases_pattern :
- cases_pattern -> interpretation ->
- ((cases_pattern * subscopes) list * (cases_pattern list * subscopes) list) *
- (int * cases_pattern list)
+ 'a cases_pattern_g -> interpretation ->
+ (('a cases_pattern_g * subscopes) list * ('a cases_pattern_g list * subscopes) list) *
+ (int * 'a cases_pattern_g list)
val match_notation_constr_ind_pattern :
- inductive -> cases_pattern list -> interpretation ->
- ((cases_pattern * subscopes) list * (cases_pattern list * subscopes) list) *
- (int * cases_pattern list)
+ inductive -> 'a cases_pattern_g list -> interpretation ->
+ (('a cases_pattern_g * subscopes) list * ('a cases_pattern_g list * subscopes) list) *
+ (int * 'a cases_pattern_g list)
(** {5 Matching a notation pattern against a [glob_constr]} *)