Revert "Does not work"

This reverts commit cbf565d4c0.
This commit is contained in:
Your Name 2019-03-05 21:00:44 +01:00
parent cbf565d4c0
commit a6585b6e91
2 changed files with 16 additions and 5 deletions

16
AST.mli
View File

@ -161,7 +161,8 @@ type ('a, 'type_expr_typecheck) gadt_if =
sufficient.
*)
type 'x x_sig = 'x
constraint 'x = 'type_annotation * 'type_expr_typecheck
constraint 'x = < annot: 'type_annotation;
type_expr_typecheck: 'bool1 >
type 'x ast = {
types : 'x type_decl reg list;
@ -220,7 +221,8 @@ and 'x type_expr =
| Function of (('x type_expr list) * 'x type_expr, 'type_expr_typecheck) gadt_if
| Mutable of ('x type_expr, 'type_expr_typecheck) gadt_if
| Unit of (unit, 'type_expr_typecheck) gadt_if
constraint 'x = ('type_annotation * 'type_expr_typecheck)
constraint 'x = < type_expr_typecheck: 'type_expr_typecheck;
.. >
constraint 'x = 'x x_sig
and 'x cartesian = ('x type_expr, times) nsepseq reg
@ -503,9 +505,15 @@ constraint 'x = 'x x_sig
(* Variations on the AST *)
type parse_phase = (unit * tfalse)
type parse_phase = <
annot: unit;
type_expr_typecheck: tfalse;
>
type typecheck_phase = (parse_phase type_expr * ttrue)
type typecheck_phase = <
annot: typecheck_phase type_expr;
type_expr_typecheck: ttrue;
>
type t = parse_phase ast

View File

@ -3,7 +3,10 @@ module SMap = Map.Make(String)
open AST
type i = parse_phase
type typecheck_phase = (parse_phase type_expr * tfalse)
type typecheck_phase = <
annot: typecheck_phase type_expr;
type_expr_typecheck: tfalse;
>
type o = typecheck_phase
type te = o type_expr list SMap.t (* Type environment *)