@@ -125,14 +125,19 @@ let sexp_of_constant_body e =
125
125
(* We cannot handle VM values *)
126
126
sexp_of_constant_body { e with const_body_code = None }
127
127
128
+ (*
129
+ module Retroknowledge =
130
+ struct
128
131
module MRK = struct
129
- type 'a t = 'a Declarations .module_retroknowledge
130
- let name = " Declarations.module_retroknowledge "
132
+ type t = Retroknowledge.action
133
+ let name = "Retroknowledge.action "
131
134
end
132
135
133
- module B_ = SerType. Opaque1 (MRK )
134
- type 'a module_retroknowledge = 'a B_ .t
135
- [@@ deriving sexp ,yojson,hash,compare]
136
+ module B_ = SerType.Opaque(MRK)
137
+ type action = B_.t
138
+ [@@deriving sexp,yojson,hash,compare]
139
+ end
140
+ *)
136
141
137
142
type recursivity_kind =
138
143
[% import: Declarations .recursivity_kind ]
@@ -188,6 +193,34 @@ type 'a with_declaration =
188
193
[% import: 'a Declarations .with_declaration ]
189
194
[@@ deriving sexp ,yojson,hash,compare]
190
195
196
+ type mod_body =
197
+ [% import: Declarations .mod_body ]
198
+ [@@ deriving sexp ,yojson,hash,compare]
199
+
200
+ type mod_type =
201
+ [% import: Declarations .mod_type ]
202
+ [@@ deriving sexp ,yojson,hash,compare]
203
+
204
+ module WMBBiject = struct
205
+ type ('a, 'b) t = ('a , 'b ) Declarations .when_mod_body
206
+
207
+ type ('a, 'b) _t = 'b option
208
+ [@@ deriving sexp ,yojson,hash,compare]
209
+
210
+ let to_t (type a b ) (x : b option ) : (a, b) Declarations.when_mod_body = match x with
211
+ | Some x -> Obj. magic @@ Declarations. ModBodyVal x
212
+ | None -> Obj. magic @@ Declarations. ModTypeNul
213
+
214
+ let of_t (type a ) (type b ) (x : (a, b) Declarations.when_mod_body ) : b option = match x with
215
+ | Declarations. ModBodyVal x -> Some x
216
+ | Declarations. ModTypeNul -> None
217
+ end
218
+
219
+ module WMB = SerType. Biject2 (WMBBiject )
220
+
221
+ type ('a, 'b) when_mod_body = ('a , 'b ) WMB .t
222
+ [@@ deriving sexp ,yojson,hash,compare]
223
+
191
224
type 'a module_alg_expr =
192
225
[% import: 'a Declarations .module_alg_expr ]
193
226
[@@ deriving sexp ,yojson,hash,compare]
0 commit comments