package accessor

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

Source file subtyping_intf.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
open! Base
open! Import


module type Subtyping = sig
  (** The subtyping scheme for accessors involves the following "feature" types. Each kind
      of accessor is defined by the features it has. If an accessor A's features is a
      subset of another accessor B's features, then A is a supertype of B. *)

  type at_least_one = [ `at_least_one ]
  type at_most_one = [ `at_most_one ]
  type coerce = [ `coerce ]
  type construct = [ `construct ]
  type get = [ `get ]
  type map = [ `map ]
  type constructor = construct

  type equality =
    [ get
    | map
    | at_most_one
    | at_least_one
    | construct
    | coerce
    ]

  type field =
    [ get
    | map
    | at_most_one
    | at_least_one
    ]

  type getter =
    [ get
    | at_least_one
    | at_most_one
    ]

  type isomorphism =
    [ get
    | map
    | at_most_one
    | at_least_one
    | construct
    ]

  type many =
    [ get
    | map
    ]

  type many_getter = get
  type mapper = map

  type nonempty =
    [ get
    | map
    | at_least_one
    ]

  type nonempty_getter =
    [ get
    | at_least_one
    ]

  type optional =
    [ get
    | map
    | at_most_one
    ]

  type optional_getter =
    [ get
    | at_most_one
    ]

  type variant =
    [ get
    | map
    | at_most_one
    | construct
    ]
end
with type at_least_one := [ `at_least_one ]
 and type at_most_one := [ `at_most_one ]
 and type coerce := [ `coerce ]
 and type construct := [ `construct ]
 and type get := [ `get ]
 and type map := [ `map ]
OCaml

Innovation. Community. Security.