File: example.ml

package info (click to toggle)
ppx-bin-prot 0.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 396 kB
  • sloc: ml: 5,351; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (3)
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
type nonrec int = int [@@deriving bin_shape ~basetype:"int"]
type nonrec float = float [@@deriving bin_shape ~basetype:"float"]
type nonrec string = string [@@deriving bin_shape ~basetype:"string"]
type nonrec 'a list = 'a list [@@deriving bin_shape ~basetype:"list"]

module M1 = struct
  type t = int * float u * string list

  and 'a u =
    { foo : 'a
    ; bar : t list
    }
  [@@deriving bin_shape]
end

module M2 : sig
  type t [@@deriving bin_shape]
end = struct
  type t = int [@@deriving bin_shape]
end

module M3 = struct
  type t = int [@@deriving bin_shape]
  type u = t list [@@deriving bin_shape]
  type v = int list [@@deriving bin_shape]
end