Skip to content

Commit 5b28214

Browse files
committed
Made links in Commands relative but correct
1 parent fd0ebd8 commit 5b28214

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

docs/src/processes/commands/looping_and_branching.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Looping & Branching
22

3-
We’ve now seen how commands work with [choice types](/types/choice.md) (via selection),
4-
and [function types](/types/function.md) (via sending). But those aren’t the only types that
3+
We’ve now seen how commands work with [choice types](../../types/choice.md) (via selection),
4+
and [function types](../../types/function.md) (via sending). But those aren’t the only types that
55
come with their own command styles. Every type does.
66

77
Let’s turn our attention to something more intricate: **recursive types.**
@@ -15,8 +15,8 @@ type List<a> = recursive either {
1515
}
1616
```
1717

18-
The `List` type is [recursive](/types/recursive.md), and contains an
19-
[`either`](/types/either.md), and within that, a [pair](/types/pair.md).
18+
The `List` type is [recursive](../../types/recursive.md), and contains an
19+
[`either`](../../types/either.md), and within that, a [pair](../../types/pair.md).
2020

2121
To work with such a structure in process syntax, we’ll need to combine three kinds of commands:
2222

@@ -69,15 +69,15 @@ not return something.
6969

7070
There's another key difference: notice the `.item` branch has `=>` right after the branch name!
7171
There's no pattern. That's because in process syntax, binding the payload of an
72-
[either](/types/either.md) is optional. Normally, **the subject itself becomes the payload.**
72+
[either](../../types/either.md) is optional. Normally, **the subject itself becomes the payload.**
7373
However, it is possible to match the payload fully, if desired.
7474

7575
So, inside the `.item` branch, `strings` now has the type `(String) List<String>` — it’s a pair, and
7676
we want to peel off its first part, to add it to the string builder.
7777

7878
There's **one last important detail,** and that's concerning **control flow.** If a `.case`
7979
branch process does not end (we'll learn about ending processes in the section about
80-
[`chan` expressions](/processes/chan_expression.md)), then it proceeds to the next line after the closing
80+
[`chan` expressions](../chan_expression.md)), then it proceeds to the next line after the closing
8181
parenthesis of the `.case` command. All local variables are kept.
8282

8383
## Receiving
@@ -117,7 +117,7 @@ tagging along the control flow of `strings`.
117117
## Patterns in `.case` branches
118118

119119
The `.item =>` branch can be made a little more pleasant. If the subject after .begin is a
120-
[pair](/types/pair.md), we’re allowed to use pattern matching directly in the `.case` branch.
120+
[pair](../../types/pair.md), we’re allowed to use pattern matching directly in the `.case` branch.
121121

122122
That means this:
123123

@@ -157,10 +157,10 @@ def TestConcat = Concat(*("A", "B", "C")) // = "ABC"
157157
```
158158

159159
This beautifully ties together all the commands we've covered so far:
160-
- **Selection** for [choices](/types/choice.md).
161-
- **Sending** for [functions](/types/function.md).
162-
- **Branching** for [eithers](/types/either.md).
163-
- **Receiving** for [pairs](/types/pair.md). Here, in the form of a pattern.
160+
- **Selection** for [choices](../../types/choice.md).
161+
- **Sending** for [functions](../../types/function.md).
162+
- **Branching** for [eithers](../../types/either.md).
163+
- **Receiving** for [pairs](../../types/pair.md). Here, in the form of a pattern.
164164

165165
The _receive commands_ is the least clearly useful here. Let's move to infinite sequences to see a
166166
more compelling use-case.

docs/src/processes/commands/receiving_where_it_shines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def Fibonacci =
3333

3434
The internal state of the sequence is a pair `(a) b`. On each `.next`, we emit `a` and update
3535
the pair. This is a clean and elegant use of corecursive iteration, as we've covered it in the
36-
section on [iterative types](/types/iterative.md).
36+
section on [iterative types](../../types/iterative.md).
3737

3838
So far so good — but how do we use this value?
3939

@@ -50,7 +50,7 @@ That means:
5050

5151
We’ll need a way to loop **exactly 30 times.** But there’s a catch: In Par,
5252
**looping is only possible on recursive types.** There’s no built-in recursion on `Nat`, so we need
53-
to convert the number 30 into a [recursive](/types/recursive.md).
53+
to convert the number 30 into a [recursive](../../types/recursive.md).
5454

5555
Good news: there’s a built-in helper for that! It's called `Nat.Repeat`, here's its type:
5656

docs/src/processes/commands/selecting_and_sending.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type String.Builder = iterative choice {
1010
```
1111

1212
It's basically an object, in an OOP-fashion, with two methods: `.add` and `.build`. At the top
13-
level, it's an [iterative](/types/iterative.md) [choice](/types/choice.md): an object that
13+
level, it's an [iterative](../../types/iterative.md) [choice](../../types/choice.md): an object that
1414
can be repeatedly interacted with.
1515

1616
We construct an empty `String.Builder` using the built-in definition of the same name:
@@ -25,12 +25,12 @@ def LetsBuildStrings = do {
2525

2626
Now, we have a local variable `builder` of the type `String.Builder`.
2727

28-
When learning about [iterative](/types/iterative.md) types, we learned that we can treat them
28+
When learning about [iterative](../../types/iterative.md) types, we learned that we can treat them
2929
as their underlying body. For `String.Builder`, it's a **choice type,** and the command for those is
3030
the **selection command.**
3131

3232
All commands start with their subject. Here it's the `builder` variable. The selection command
33-
itself then looks the same as the usual [destruction of a choice](/types/choice.md#destruction).
33+
itself then looks the same as the usual [destruction of a choice](../../types/choice.md#destruction).
3434

3535
```par
3636
def LetsBuildStrings = do {
@@ -46,7 +46,7 @@ of the selected branch. Here's the one we selected:
4646
.add(String) => self,
4747
```
4848

49-
The argument on the left side of `=>` is just a syntax sugar for a [function](/types/function.md).
49+
The argument on the left side of `=>` is just a syntax sugar for a [function](../../types/function.md).
5050
De-sugared, it is:
5151

5252
```par

0 commit comments

Comments
 (0)