@@ -197,7 +197,7 @@ let invalid_args_fallback =
197197 let (arg_info , arg_elab , m ) = uexp_to_info_map(~ctx, ~ana= syn, arg, m);
198198 add(
199199 ~elab_term= mk_builtin_ap_elab(fn_info, arg_elab),
200- ~elab_syn_ty = unknown,
200+ ~formation = MatchedTyp . identity( unknown) ,
201201 ~marks= [ error] ,
202202 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg_info. co_ctx] ),
203203 m,
@@ -260,7 +260,7 @@ let handle_tuple_operation =
260260 let result_type = compute_result_type(labeled_tup_info, labels);
261261 add(
262262 ~elab_term= mk_builtin_ap_elab(fn_info, arg_elab),
263- ~elab_syn_ty = result_type,
263+ ~formation = MatchedTyp . identity( result_type) ,
264264 ~marks= [] ,
265265 ~co_ctx= CoCtx . union([ fn_info. co_ctx, tup_info. co_ctx] ),
266266 m,
@@ -479,7 +479,7 @@ let group_by_label_statics =
479479
480480 add(
481481 ~elab_term= mk_builtin_ap_elab(fn_info, arg_elab),
482- ~elab_syn_ty = unknown,
482+ ~formation = MatchedTyp . identity( unknown) ,
483483 ~marks= [] ,
484484 ~co_ctx= CoCtx . union([ fn_info. co_ctx, table_info. co_ctx] ),
485485 m,
@@ -528,14 +528,17 @@ let to_lvs_statics =
528528
529529 add(
530530 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
531- ~elab_syn_ty=
532- IdTagged . FreshGrammar . Typ . (
533- list(
534- prod([
535- tup_label(label("label" ), string() ),
536- tup_label(label("value" ), joined_typ),
537- ] ),
538- )
531+ ~formation=
532+ MatchedTyp . form(
533+ MatchedTyp . list_former,
534+ [
535+ IdTagged . FreshGrammar . Typ . (
536+ prod([
537+ tup_label(label("label" ), string() ),
538+ tup_label(label("value" ), joined_typ),
539+ ] )
540+ ),
541+ ] ,
539542 ),
540543 ~marks= [] ,
541544 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
@@ -544,7 +547,7 @@ let to_lvs_statics =
544547 | _ =>
545548 add(
546549 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
547- ~elab_syn_ty = ty_out,
550+ ~formation = MatchedTyp . identity( ty_out) ,
548551 ~marks= [ BuiltinError (ToLvsMissingLabelsOnTuple (ty_out))] ,
549552 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
550553 m,
@@ -553,15 +556,15 @@ let to_lvs_statics =
553556 | Unknown (_ ) =>
554557 add(
555558 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
556- ~elab_syn_ty = ty_out,
559+ ~formation = MatchedTyp . identity( ty_out) ,
557560 ~marks= [] ,
558561 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
559562 m,
560563 )
561564 | _ =>
562565 add(
563566 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
564- ~elab_syn_ty = ty_out,
567+ ~formation = MatchedTyp . identity( ty_out) ,
565568 ~marks= [ BuiltinError (ToLvsMissingLabelsOnTuple (ty_out))] ,
566569 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
567570 m,
@@ -597,23 +600,27 @@ let omit_all_labels_statics =
597600
598601 add(
599602 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
600- ~elab_syn_ty= Typ . to_product(entries),
603+ ~formation=
604+ MatchedTyp . form(
605+ MatchedTyp . prod_former(List . length(entries)),
606+ entries,
607+ ),
601608 ~marks= [] ,
602609 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
603610 m,
604611 );
605612 | Unknown (_ ) =>
606613 add(
607614 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
608- ~elab_syn_ty = ty_out,
615+ ~formation = MatchedTyp . identity( ty_out) ,
609616 ~marks= [] ,
610617 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
611618 m,
612619 )
613620 | _ =>
614621 add(
615622 ~elab_term= mk_builtin_ap_elab(fn_info, arg. elab_term),
616- ~elab_syn_ty = unknown,
623+ ~formation = MatchedTyp . identity( unknown) ,
617624 ~marks= [ BuiltinError (ArgumentMustBeTuple )] ,
618625 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg. co_ctx] ),
619626 m,
@@ -662,7 +669,8 @@ let custom_statics_deferred_ap =
662669 let (_ , m ) = validate_label_arguments((module S ), ~ctx, labels, m);
663670
664671 add(
665- ~elab_syn_ty= Arrow (unknown, unknown) |> Typ . temp,
672+ ~formation=
673+ MatchedTyp . form(MatchedTyp . arrow_former, [ unknown, unknown] ),
666674 ~marks= [] ,
667675 ~co_ctx= CoCtx . union([ fn_info. co_ctx, tup_info. co_ctx] ),
668676 m,
@@ -674,7 +682,7 @@ let custom_statics_deferred_ap =
674682 validate_label_arguments((module S ), ~ctx, [ pivot_label] , m);
675683
676684 add(
677- ~elab_syn_ty = unknown,
685+ ~formation = MatchedTyp . identity( unknown) ,
678686 ~marks= [] ,
679687 ~co_ctx= CoCtx . union([ fn_info. co_ctx, table_info. co_ctx] ),
680688 m,
@@ -684,7 +692,7 @@ let custom_statics_deferred_ap =
684692 let (arg_info , _ , m ) = uexp_to_info_map(~ctx, ~ana= syn, arg, m);
685693
686694 add(
687- ~elab_syn_ty = unknown,
695+ ~formation = MatchedTyp . identity( unknown) ,
688696 ~marks= [] ,
689697 ~co_ctx= CoCtx . union([ fn_info. co_ctx, arg_info. co_ctx] ),
690698 m,
@@ -702,7 +710,7 @@ let custom_statics_deferred_ap =
702710 );
703711
704712 add(
705- ~elab_syn_ty = unknown,
713+ ~formation = MatchedTyp . identity( unknown) ,
706714 ~marks= [ BuiltinError (AtLeast2Arguments )] ,
707715 ~co_ctx= combined_co_ctx,
708716 m,
@@ -720,7 +728,7 @@ let custom_statics_deferred_ap =
720728 );
721729
722730 add(
723- ~elab_syn_ty = unknown,
731+ ~formation = MatchedTyp . identity( unknown) ,
724732 ~marks= [ BuiltinError (Exactly2Arguments )] ,
725733 ~co_ctx= combined_co_ctx,
726734 m,
@@ -742,7 +750,8 @@ let custom_statics_deferred_ap =
742750 |> Typ . to_product;
743751
744752 add(
745- ~elab_syn_ty= Arrow (ty_in', unknown) |> Typ . temp,
753+ ~formation=
754+ MatchedTyp . form(MatchedTyp . arrow_former, [ ty_in', unknown] ),
746755 ~marks= [] ,
747756 ~co_ctx= combined_co_ctx,
748757 m,
0 commit comments