blob: 407ced1d18973993ec698b31790467dfcc35adc9 (
plain)
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
91
92
93
94
95
|
# * module type VALUE = sig type value type state type usert end
# module type CORE0 =
sig
module V : VALUE
val setglobal : V.state -> string -> V.value -> unit
end
# module type CORE =
sig
module V : VALUE
val setglobal : V.state -> string -> V.value -> unit
val apply : V.value -> V.state -> V.value list -> V.value
end
# module type AST =
sig
module Value : VALUE
type chunk
type program
val get_value : chunk -> Value.value
end
# module type EVALUATOR =
sig
module Value : VALUE
module Ast :
sig type chunk type program val get_value : chunk -> Value.value end
type state = Value.state
type value = Value.value
exception Error of string
val compile : Ast.program -> string
val setglobal : Value.state -> string -> Value.value -> unit
end
# module type PARSER = sig type chunk val parse : string -> chunk end
# module type INTERP =
sig
module Value : VALUE
module Ast :
sig type chunk type program val get_value : chunk -> Value.value end
type state = Value.state
type value = Value.value
exception Error of string
val compile : Ast.program -> string
val setglobal : Value.state -> string -> Value.value -> unit
module Parser :
sig type chunk = Ast.chunk val parse : string -> chunk end
val dostring : state -> string -> value list
val mk : unit -> state
end
# module type USERTYPE =
sig type t val eq : t -> t -> bool val to_string : t -> string end
# module type TYPEVIEW =
sig type combined type t val map : (combined -> t) * (t -> combined) end
# module type COMBINED_COMMON =
sig
module T : sig type t end
module TV1 : sig type t val map : (T.t -> t) * (t -> T.t) end
module TV2 : sig type t val map : (T.t -> t) * (t -> T.t) end
end
# module type COMBINED_TYPE =
sig
module T : USERTYPE
module TV1 : sig type t val map : (T.t -> t) * (t -> T.t) end
module TV2 : sig type t val map : (T.t -> t) * (t -> T.t) end
end
# module type BARECODE = sig type state val init : state -> unit end
# module USERCODE :
functor (X : TYPEVIEW) ->
sig
module type F =
functor
(C : sig
module V :
sig type value type state type usert = X.combined end
val setglobal : V.state -> string -> V.value -> unit
val apply : V.value -> V.state -> V.value list -> V.value
end) ->
sig val init : C.V.state -> unit end
end
# module Weapon : sig type t end
# module type WEAPON_LIB =
sig
type t = Weapon.t
module T :
sig type t = t val eq : t -> t -> bool val to_string : t -> string end
module Make :
functor
(TV : sig
type combined
type t = t
val map : (combined -> t) * (t -> combined)
end) ->
USERCODE(TV).F
end
# module type X = functor (X : CORE) -> BARECODE
# module type X = functor (_ : CORE) -> BARECODE
#
|