You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Infix operators**: Where can I find documentation on standard infix
124
124
operators such as `@@`?
125
-
125
+
126
126
For general documentation on operators, see the OCaml manual: [Operators](https://caml.inria.fr/pub/docs/manual-ocaml/expr.html#sec151)
127
-
in the Expressions section, [Index of values](http://caml.inria.fr/pub/docs/manual-ocaml/libref/index_values.html), or the
128
-
[Stdlib module documentation](http://caml.inria.fr/pub/docs/manual-ocaml/libref/Stdlib.html). For the Stdlib document,
127
+
in the Expressions section, [Index of values](http://v2.ocaml.org/api/index_values.html), or the
128
+
[Stdlib module documentation](http://v2.ocaml.org/api/Stdlib.html). For the Stdlib document,
129
129
you'll want to search the page for "operator" or for the specific operator you're interested in.
130
-
130
+
131
131
For operator precedence and associativity, see the [Expressions](https://caml.inria.fr/pub/docs/manual-ocaml/expr.html)
132
-
section of the manual, and scroll down past the BNF syntax specification or search for "Construction or operator". The
132
+
section of the manual, and scroll down past the BNF syntax specification or search for "Construction or operator". The
133
133
Stdlib module also specifies precedence and associativity in the documentation for each operator.
134
-
134
+
135
135
(Also possibly useful: [Built-in operators and functions](https://www2.lib.uchicago.edu/keith/ocaml-class/operators.html)
136
136
at *OCaml for the Skeptical*.)
137
137
138
138
***ppx**: What are these `[%% ...]`, `[@@ ...]` expressions that I
139
-
see in people's code? What does it mean when there's a percent sign in the
139
+
see in people's code? What does it mean when there's a percent sign in the
140
140
middle of a name, as in `let%lwt`? What are extension points?
141
-
141
+
142
142
See [A Guide to PreProcessor eXtensions](ppx.md) or [A Tutorial to OCaml -ppx Language Extensions](https://www.victor.darvariu.me/jekyll/update/2018/06/19/ppx-tutorial.html).
143
143
144
144
***+'a, -'a**: Why are some type variables prefaced by "+" or "-",
145
145
as in `type +'a t`?
146
-
146
+
147
147
These are called "variance annotations". They're used to constrain
148
148
subtyping relations. See [+'a and
149
149
-'a](https://blog.janestreet.com/a-and-a) at the Jane Street Tech
150
150
Blog.
151
151
152
152
***open!**: What's the difference between `open My_module` and
153
153
`open! My_module`?
154
-
154
+
155
155
Both make the values and types in `My_module` available without having
156
156
to write "My_module." in front of them. `open My_module` will trigger
157
157
a warning if `My_module` overrides existing definitions. `open!` suppresses
158
158
this warning. See [Overriding in open statements](http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec250)
159
159
from [Chapter 8 Language extensions](http://caml.inria.fr/pub/docs/manual-ocaml/extn.html) in
160
-
the OCaml manual.
161
-
160
+
the OCaml manual.
161
+
162
162
At present `open!` also suppresses another warning as well. This is a warning
163
163
that no definition in the opened module is in fact used within
164
164
`open!`'s scope. There is some disagreement about whether this behavior
@@ -167,4 +167,3 @@ how to cope with them.
167
167
a module as a way of providing an alternative standard programming environment.
168
168
See the discussion at this OCaml PR: [Fix PR6638: "unused open" warning was incorrectly suppressed
169
169
by "open!"](https://github.com/ocaml/ocaml/pull/1110).
Copy file name to clipboardExpand all lines: content/standard_libraries.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ tags: [ecosystem]
4
4
5
5
# Standard Libraries
6
6
7
-
OCaml comes with its own [Standard Library](https://caml.inria.fr/pub/docs/manual-ocaml/libref/).
7
+
OCaml comes with its own [Standard Library](https://v2.ocaml.org/api/).
8
8
Most OCamlers, however, agree that the built-in standard library is problematic: it's not comprehensive
9
9
enough, and it uses outmoded patterns, such as using exceptions rather than error types. The community has
10
10
had trouble expanding the library due to namespacing issues.
@@ -16,7 +16,7 @@ no-exception counterparts.
16
16
In the absence of a comprehensive standard library, several competitors developed. Due to OCaml's support for
17
17
modularity, each can be swapped out for the other wholesale.
18
18
19
-
* The [standard library](https://caml.inria.fr/pub/docs/manual-ocaml/libref/) offers a selection of functional
19
+
* The [standard library](https://v2.ocaml.org/api/) offers a selection of functional
20
20
data structures (List, Map) and imperative data structures (Array, Queue, Stack). Many of the functions throw
21
21
an exception rather than returning an option type. The library also includes the Unix module, which, despite its
22
22
name, has many functions that work on Windows. The Unix module is a catch-all for many IO-processing functions.
@@ -32,7 +32,7 @@ similar to the ListLabels, ArrayLabels, etc modules in the standard library. Add
32
32
polymorphic comparison anywhere in its API.
33
33
*[Documentation for Base](https://ocaml.janestreet.com/ocaml-core/latest/doc/base/index.html)
34
34
*[Containers](https://github.com/c-cube/ocaml-containers) is a lightweight and modern-style standard library which
35
-
extends the standard library with additional functionality while applying more modern design concepts. Code written using the stdlib should continue working after adding `open Containers`, and benefit from richer `List`, `Option`, `Seq`, etc. modules. A few new modules are introduced for critical functionalities, such as `Vector`, `Heap`, `IO`, and `Sexp`.
35
+
extends the standard library with additional functionality while applying more modern design concepts. Code written using the stdlib should continue working after adding `open Containers`, and benefit from richer `List`, `Option`, `Seq`, etc. modules. A few new modules are introduced for critical functionalities, such as `Vector`, `Heap`, `IO`, and `Sexp`.
36
36
*[Documentation for Containers](http://c-cube.github.io/ocaml-containers/last/containers/index.html)
37
37
* The accompanying library [containers-data](http://c-cube.github.io/ocaml-containers/last/containers-data/index.html) contains additional data structures such as bitvectors, graphs, Patricia trees, etc.
38
38
*[Core](https://github.com/janestreet/core) is Jane Street's expanded standard library, sitting on top of Base.
0 commit comments