aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/check.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/syntax/check.mli')
-rw-r--r--lib/syntax/check.mli37
1 files changed, 15 insertions, 22 deletions
diff --git a/lib/syntax/check.mli b/lib/syntax/check.mli
index 276e51f..c831b67 100644
--- a/lib/syntax/check.mli
+++ b/lib/syntax/check.mli
@@ -1,34 +1,27 @@
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
+type t
+(** Type of check to apply *)
+
+val build :
+ (module S.Analyzer
+ with type Expression.t = 'a
+ and type Instruction.t = 'b
+ and type Location.t = 'c) ->
+ 'a Id.typeid * 'b Id.typeid * 'c Id.typeid * t
+(** Build a new check from a module following S.Analyzer signature *)
module type App = sig
- val t : transform array
+ val t : t array
end
-type result = R : { value : 'a; witness : 'a Id.typeid } -> result
+type result
+
+val get : 'a Id.typeid -> result -> 'a option
+(** Retrieve the information with the given type *)
module Make (A : App) : sig
include