Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(docs) Add link for instances of Array #2146

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/tutorials/language/0it_02_loops_and_recursion.md
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,8 @@ slow for some types of operation. For example, getting the head of a
list, or iterating over a list to perform some operation on each element,
is reasonably fast. However, when jumping to the n<sup>th</sup> element of a
list or trying to randomly access a list, you'll find that both are slow operations.
The OCaml `Array` type is a real array, so random access is fast, but
insertion and deletion of elements is slow. `Array`s are also mutable, so
The OCaml [`Array`](/api/Array.html) type is a real array, so random access is fast, but
insertion and deletion of elements is slow. [`Array`](/api/Array.html)s are also mutable, so
you can randomly change elements, too.

The basics of arrays are simple:
Expand Down
2 changes: 1 addition & 1 deletion data/tutorials/language/1ms_00_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ let () = hello ()
```

Using `open` is optional. Usually, we don't open a module like `List` because it
provides names other modules also provide, such as `Array` or `Option`. Modules
provides names other modules also provide, such as [`Array`](/api/Array.html) or `Option`. Modules
like `Printf` provide names that aren't subject to conflicts, such as `printf`.
Placing `open Printf` at the top of a file avoids writing `Printf.printf` repeatedly.
```ocaml
Expand Down
4 changes: 2 additions & 2 deletions data/tutorials/language/1ms_01_functors.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ The dependency `List` is _injected_ when compiling the module `Funkt`. Observe t

**Replacing a Dependency**

Now, replacing the implementation of `iter` inside `IterListPrint` is no longer a refactoring; it is another functor application with another dependency. Here, `Array` replaces `List`:
Now, replacing the implementation of `iter` inside `IterListPrint` is no longer a refactoring; it is another functor application with another dependency. Here, [`Array`](/api/Array.html) replaces `List`:

**`funkt.ml`**
```ocaml
Expand Down Expand Up @@ -420,7 +420,7 @@ In the example above, `t` from `with type` takes precedence over the local `t`,

In this section, we define a functor to extend several modules in the same way. This is the same idea as in the [Extending a Module with a Standard Library Functor](#extending-a-module-with-a-standard-library-functor), except we write the functor ourselves.

In this example, we extend `List` and `Array` modules with a function `scan_left`. It does almost the same as `fold_left`, except it returns all the intermediate values, not the last one as `fold_left` does.
In this example, we extend `List` and [`Array`](/api/Array.html) modules with a function `scan_left`. It does almost the same as `fold_left`, except it returns all the intermediate values, not the last one as `fold_left` does.

Create a fresh directory with the following files:

Expand Down
4 changes: 2 additions & 2 deletions data/tutorials/language/3ds_01_arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To modify an element in an array, we simply assign a new value to it using the i

Note that this operation returns `unit`, not the modified array. `even_numbers` is modified in place as a side effect.

## The Standard Library `Array` Module
## The Standard Library [`Array`](/api/Array.html) Module

OCaml provides several useful functions for working with arrays. Here are some of the most common ones:

Expand Down Expand Up @@ -176,4 +176,4 @@ This copies two elements of `zeroes`, starting at index `1` into the last part o

## Conclusion

In this tutorial, we covered the basics of arrays in OCaml, including how to create and manipulate them, as well as some of the most useful functions and use cases. Please refer to the [standard library documentation](/api/Array.html) to browse the complete list of functions of the `Array` module.
In this tutorial, we covered the basics of arrays in OCaml, including how to create and manipulate them, as well as some of the most useful functions and use cases. Please refer to the [standard library documentation](/api/Array.html) to browse the complete list of functions of the [`Array`](/api/Array.html) module.
2 changes: 1 addition & 1 deletion data/tutorials/language/3ds_05_seq.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ instance:
* `Seq.map`
* `Seq.fold_left`

All those are also available for `Array`, `List`, and `Set` and behave
All those are also available for [`Array`](/api/Array.html), `List`, and `Set` and behave
essentially the same. Observe that there is no `fold_right` function. Since
OCaml 4.11, there is something which isn't (yet) available on other types:
`unfold`. Here is how it is implemented:
Expand Down