File: type_generic_intf.ml

package info (click to toggle)
typerep 1%3A0.17.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 260 kB
  • sloc: ml: 2,583; makefile: 14
file content (67 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download
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
module M (X : sig
  type 'a t
end) =
struct
  module type S = sig
    type t

    include Typerepable.S with type t := t

    val compute : t X.t
  end

  module type S1 = sig
    type 'a t

    include Typerepable.S1 with type 'a t := 'a t

    val compute : 'a X.t -> 'a t X.t
  end

  module type S2 = sig
    type ('a, 'b) t

    include Typerepable.S2 with type ('a, 'b) t := ('a, 'b) t

    val compute : 'a X.t -> 'b X.t -> ('a, 'b) t X.t
  end

  module type S3 = sig
    type ('a, 'b, 'c) t

    include Typerepable.S3 with type ('a, 'b, 'c) t := ('a, 'b, 'c) t

    val compute : 'a X.t -> 'b X.t -> 'c X.t -> ('a, 'b, 'c) t X.t
  end

  module type S4 = sig
    type ('a, 'b, 'c, 'd) t

    include Typerepable.S4 with type ('a, 'b, 'c, 'd) t := ('a, 'b, 'c, 'd) t

    val compute : 'a X.t -> 'b X.t -> 'c X.t -> 'd X.t -> ('a, 'b, 'c, 'd) t X.t
  end

  module type S5 = sig
    type ('a, 'b, 'c, 'd, 'e) t

    include Typerepable.S5 with type ('a, 'b, 'c, 'd, 'e) t := ('a, 'b, 'c, 'd, 'e) t

    val compute
      :  'a X.t
      -> 'b X.t
      -> 'c X.t
      -> 'd X.t
      -> 'e X.t
      -> ('a, 'b, 'c, 'd, 'e) t X.t
  end
end

module type S = sig
  type 'a t

  include module type of M (struct
    type 'a computation = 'a t
    type 'a t = 'a computation
  end)
end