From b38bcd572d6f827a1b639933c8cf0fbe3b832a8d Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Fri, 13 Oct 2023 14:26:26 +0200 Subject: New checker which operate accumulate differents other checkers --- lib/syntax/check.mli | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/syntax/check.mli (limited to 'lib/syntax/check.mli') diff --git a/lib/syntax/check.mli b/lib/syntax/check.mli new file mode 100644 index 0000000..276e51f --- /dev/null +++ b/lib/syntax/check.mli @@ -0,0 +1,40 @@ +module Id : sig + type 'a typeid + (** The type created on-the-fly. *) + + val newtype : unit -> 'a typeid + (** Create a new instance of a dynamic type *) + + type ('a, 'b) eq = Eq : ('a, 'a) eq + + val try_cast : 'a typeid -> 'b typeid -> ('a, 'b) eq option + (** Compare two types using the Eq pattern *) +end + +type transform = + | E : { + module_ : + (module S.Analyzer + with type Expression.t = 'a + and type Instruction.t = 'b + and type Location.t = 'c); + expr_witness : 'a Id.typeid; + instr_witness : 'b Id.typeid; + location_witness : 'c Id.typeid; + } + -> transform + +module type App = sig + val t : transform array +end + +type result = R : { value : 'a; witness : 'a Id.typeid } -> result + +module Make (A : App) : sig + include + S.Analyzer + with type Location.t = result array + and type Instruction.t' = result array + and type Expression.t' = result array +end +[@@warning "-67"] -- cgit v1.2.3