package hardcaml_step_testbench

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file data.ml

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
open! Base
include Data_intf

type 'd t = (module S with type t = 'd)

module Bool = struct
  type t = bool [@@deriving compare, sexp_of]

  let equal = [%compare.equal: t]
  let undefined = false
end

module Int = struct
  type t = int [@@deriving compare, sexp_of]

  let equal = [%compare.equal: t]
  let undefined = 0
end

module String = struct
  type t = string [@@deriving compare, sexp_of]

  let equal = [%compare.equal: t]
  let undefined = ""
end

module Unit = struct
  type t = unit [@@deriving compare, sexp_of]

  let equal = [%compare.equal: t]
  let undefined = ()
end

module Pair (D1 : S) (D2 : S) = struct
  type t = D1.t * D2.t [@@deriving sexp_of]

  let equal (a1, a2) (b1, b2) = D1.equal a1 b1 && D2.equal a2 b2
  let undefined = D1.undefined, D2.undefined
end
OCaml

Innovation. Community. Security.