| 1 | open! Base |
| 2 | |
| 3 | module type S = sig |
| 4 | type t [@@deriving sexp_grammar] |
| 5 | end |
| 6 | |
| 7 | module Key = struct |
| 8 | type t = int [@@deriving sexp_grammar] |
| 9 | end |
| 10 | |
| 11 | module Pair = struct |
| 12 | type ('a, 'b) t = 'a * 'b [@@deriving sexp_grammar] |
| 13 | |
| 14 | module M (A : T) = struct |
| 15 | type 'b t = A.t * 'b |
| 16 | end |
| 17 | |
| 18 | let m__t_sexp_grammar (type a) (module Key : S with type t = a) v_sexp_grammar = |
| 19 | t_sexp_grammar Key.t_sexp_grammar v_sexp_grammar |
| 20 | ;; |
| 21 | end |
| 22 | |
| 23 | type t = string Pair.M(Key).t [@@deriving_inline sexp_grammar] |
| 24 | |
| 25 | let _ = fun (_ : t) -> () |
| 26 | |
| 27 | let (t_sexp_grammar : t Sexplib0.Sexp_grammar.t) = |
| 28 | { untyped = |
| 29 | Lazy (lazy (Pair.m__t_sexp_grammar (module Key) string_sexp_grammar).untyped) |
| 30 | } |
| 31 | ;; |
| 32 | |
| 33 | let _ = t_sexp_grammar |
| 34 | |
| 35 | [@@@end] |