Skip to content
This repository
Newer
Older
100644 126 lines (111 sloc) 6.176 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 open SurfaceAst
19
20 (**)
21
22 module Remove :
23 sig
24 type ('a,'b) through
25 module Basic :
26 sig
27 val access_directive:('a, [< all_directives > `private_ `package `public ]) through
28 val access_not_public:('a, [< all_directives > `private_ `package `public ]) through
8edc0012 » Valentin Gatien-Baron
2011-07-06 [feature] adding: an @async directive on bindings to perform asynchro…
29 val async : ('a, [< all_directives > `async ]) through
fccc6851 » MLstate
2011-06-21 Initial open-source release
30 val coerce : ('a, [< all_directives > `coerce ]) through
31 val deprecated : ('a, [< all_directives > `deprecated ]) through
32 val directive : ('a, 'b) through
33 val doctype : ('a, [< all_directives > `doctype ]) through
34 val expand : ('a, [< all_directives > `expand ]) through
35 val magic_directive : ('a, [> magic_directive]) through
36 val lambda : ('a, 'b) through
37 val letin : ('a, 'b) through
38 val opacapi : ('a, [< all_directives > `opacapi ]) through
39 val opavalue_directive : ('a, [> opavalue_directive]) through
40 val open_ : ('a, [< all_directives > `open_ ]) through
41 val private_ : ('a, [< all_directives > `private_ ]) through
42 val slicer_directive:('a, [< all_directives > `side_annotation `visibility_annotation ]) through
43 val side_annotation :('a, [< all_directives > `side_annotation ]) through
44 val visibility_annotation:('a, [< all_directives > `visibility_annotation ]) through
45 end
46 val remove : through:('a, [< all_directives ] as 'b) through list -> ('a, 'b) expr -> ('a, 'b) expr
47 val coerce : ('a, [< all_directives > `coerce] as 'b) expr -> ('a, 'b) expr
48 end
49
50
51 module Look :
52 sig
53 type ('a,'b) through = ('a,'b) Remove.through
54 val apply : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
55 val lambda : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
56 val record : ?through:('a,'b) through list -> ('a, 'b) expr -> bool
57 val module_ : ?through:('a, [< all_directives > `module_ ] as 'b) through list -> ('a, 'b) expr -> bool
58 val module_local :?through:('a, [< all_directives > `module_ `local ] as 'b) through list -> ('a, 'b) expr -> bool
59 val private_ : ?through:('a, [< all_directives > `private_ ] as 'b) through list -> ('a, 'b) expr -> bool
60
61 val at : ?through:('a,'b) through list -> at:('a,'b) through list -> ('a, 'b) expr -> bool
62 (** [at ~through:patterns ~at:patterns e] returns true when [e] matches one of the patterns of [at]
63 (while ignoring [through])
64 *)
65 end
66
67 (* should be renamed GetThrough *)
68 module FoldThrough :
69 sig
70 val dot : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> ('a, 'b) expr * (string * QmlLoc.annot) list
71 val arity : ?through:('a, 'b) Remove.through list -> ('a, 'b) expr -> int option
72 val fields : ?through:('a, ([> `module_ ] as 'b)) Remove.through list -> ('a, 'b) expr -> ('a, 'b) record_node option
73 (** gets the fields of records or modules *)
74 end
75
76
77 module Context :
78 sig
79 type ('ident,'input,'output) through_with_context
80 module Basic :
81 sig
82 val coerce : ('a, [< all_directives > `coerce ], [< all_directives > `coerce ]) through_with_context
83 val directive : ('a,'b,'b) through_with_context
84 val letin : ('a,'b,'b) through_with_context
85 val opacapi : ('a,[< all_directives > `opacapi ] as 'b,'b) through_with_context
86 val opavalue_directive :
87 ('a, [> opavalue_directive ] as 'b, 'b) through_with_context
88 val open_ : ('a,[< all_directives > `open_ ] as 'b,'b) through_with_context
89 val doctype : ('a, [< all_directives > `doctype ] as 'b, 'b) through_with_context
90 val slicer_directive :
91 ('a, [< all_directives > `side_annotation `visibility_annotation] as 'b, 'b)
92 through_with_context
93 val side_annotation :
94 ('a, [< all_directives > `side_annotation] as 'b, 'b)
95 through_with_context
96 val visibility_annotation :
97 ('a, [< all_directives > `visibility_annotation] as 'b, 'b)
98 through_with_context
99
100 end
101 val remove : through:('ident, 'input, 'output) through_with_context list ->
102 ('ident, 'input) expr ->
103 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
104 val filter : keep:('ident, 'input, 'output) through_with_context list ->
105 throw:('ident,'input) Remove.through list ->
106 ('ident, 'input) expr ->
107 ('ident, 'input) expr * (('ident, 'output) expr -> ('ident, 'output) expr)
108 val filter2 : keep1:('ident, 'input, 'output) through_with_context list ->
109 keep2:('ident, 'input, 'output2) through_with_context list ->
110 throw:('ident,'input) Remove.through list ->
111 ('ident, 'input) expr ->
112 ('ident, 'input) expr *
113 (('ident, 'output) expr -> ('ident, 'output) expr) *
114 (('ident, 'output2) expr -> ('ident, 'output2) expr)
115 val uncoerce : ('a,[< all_directives > `coerce] as 'b) expr ->
116 ('a, 'b) expr * (('a, [< all_directives > `coerce ] as 'c) expr -> ('a, 'c) expr)
117 val unletin : ('a,'b) expr ->
118 ('a,'b) expr * (('a,'b) expr -> ('a,'b) expr)
119 end
120
121
122 module FoldContext :
123 sig
124 val letin : ?through:('a,'b,'c) Context.through_with_context list ->
125 ('a, 'b) expr -> ('a, 'b) expr * ('a * ('a, 'b) expr) list * (('a,'c) expr -> ('a,'c) expr)
126 end
Something went wrong with that request. Please try again.