aboutsummaryrefslogtreecommitdiff
path: root/lib/syntax/check.mli
blob: 276e51fdea9306f319e4962415b47c08b817a75f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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"]