Skip to content

Commit 948307d

Browse files
committed
Move cc docs into separate folder
Also remove redundant headings
1 parent a8b20fd commit 948307d

File tree

12 files changed

+36
-50
lines changed

12 files changed

+36
-50
lines changed

docs/_docs/reference/experimental/cc-advanced.md renamed to docs/_docs/reference/experimental/capture-checking/advanced.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: doc-page
3-
title: "Capture Checking -- Advanced Use Cases"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-advanced.html
3+
title: "Capability Polymorphism -- Advanced Use Cases"
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/advanced.html
55
---
66

77

@@ -75,4 +75,4 @@ By leveraging capability polymorphism, capability members, and path-dependent ca
7575
* `Label`s store the free capabilities `C` of the `block` passed to `boundary` in their capability member `Fv`.
7676
* When suspending on a given label, the suspension handler can capture at most the capabilities that occur freely at the `boundary` that introduced the label. That prevents mentioning nested bound labels.
7777

78-
[Back to Capability Polymorphism](cc-polymorphism.md)
78+
[Back to Capability Polymorphism](polymorphism.md)

docs/_docs/reference/experimental/cc.md renamed to docs/_docs/reference/experimental/capture-checking/cc.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: doc-page
33
title: "Capture Checking"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/cc.html
55
---
66

77
Capture checking is a research project that modifies the Scala type system to track references to capabilities in values. It can be enabled by the language import
@@ -13,14 +13,14 @@ Before trying it out, make sure you have the latest version of Scala.
1313

1414
The rest of this page explains the basics capture checking. Further topics are described in the following pages:
1515

16-
- [Capture Checking of Classes](./cc-classes.md)
17-
- [Capability Polymorphism](./cc-polymorphism.md)
18-
- [Scoped Caps](./cc-scoped-caps.md)
19-
- [Capability Classifiers](./cc-classifiers.md)
20-
- [Checked Exceptions](./cc-checked-exceptions.md)
21-
- [Separation Checking](./cc-separation-checking.md)
22-
- [How to Use the Capture Checker](./cc-how-to-use.md)
23-
- [Capture Checking Internals](./cc-internals.md)
16+
- [Capture Checking of Classes](./classes.md)
17+
- [Capability Polymorphism](./polymorphism.md)
18+
- [Scoped Caps](./scoped-caps.md)
19+
- [Capability Classifiers](./classifiers.md)
20+
- [Checked Exceptions](./checked-exceptions.md)
21+
- [Separation Checking](./separation-checking.md)
22+
- [How to Use the Capture Checker](./how-to-use.md)
23+
- [Capture Checking Internals](./internals.md)
2424

2525

2626
To get an idea what capture checking can do, let's start with a small example:

docs/_docs/reference/experimental/cc-checked-exceptions.md renamed to docs/_docs/reference/experimental/capture-checking/checked-exceptions.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
---
22
layout: doc-page
33
title: "Checked Exceptions"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-checked-exceptions.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/checked-exceptions.html
55
---
66

7-
## Checked Exceptions
8-
97
Scala enables checked exceptions through a language import. Here is an example,
10-
taken from the [safer exceptions page](./canthrow.md), and also described in a
8+
taken from the [safer exceptions page](../canthrow.md), and also described in a
119
[paper](https://infoscience.epfl.ch/record/290885) presented at the
1210
2021 Scala Symposium.
1311
```scala

docs/_docs/reference/experimental/cc-classes.md renamed to docs/_docs/reference/experimental/capture-checking/classes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
layout: doc-page
33
title: "Capture Checking of Classes"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-classes.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/classes.html
55
---
66

7-
## Capture Checking of Classes
87

98
The principles for capture checking closures also apply to classes. For instance, consider:
109
```scala

docs/_docs/reference/experimental/cc-classifiers.md renamed to docs/_docs/reference/experimental/capture-checking/classifiers.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
layout: doc-page
33
title: "Capability Classifiers"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-classifiers.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/classifiers.html
55
---
66

7-
## Capability Classifiers
8-
97
Capabilities are extremely versatile. They can express concepts from many different domains. Exceptions, continuations, I/O, mutation, information flow, security permissions, are just some examples, the list goes on.
108

119
Sometimes it is important to restrict, or: _classify_ what kind of capabilities are expected or returned in a context. For instance, we might want to allow only control capabilities such as `CanThrow`s or boundary `Label`s but no
@@ -63,7 +61,7 @@ Here is a graph showing the hierarchy of predefined classifier traits:
6361
Control Mutable
6462
```
6563
At the top of the hierarchy, we distinguish between _shared_ and _exclusive_ capabilities in two classifier traits `SharedCapability` and `ExclusiveCapability`. All capability classes we have seen so far are shared.
66-
`ExclusiveCapability` is a base trait for capabilities that allow only un-aliased access to the data they represent, with the rules governed by [separation checking](cc-separation-checking.md). Separation checking is currently an optional extension of capture checking, enabled by a different language import. Since `Capability` is a sealed trait, all capability classes are either shared or exclusive.
64+
`ExclusiveCapability` is a base trait for capabilities that allow only un-aliased access to the data they represent, with the rules governed by [separation checking](separation-checking.md). Separation checking is currently an optional extension of capture checking, enabled by a different language import. Since `Capability` is a sealed trait, all capability classes are either shared or exclusive.
6765

6866
`Control` capabilities are shared. This means they cannot directly or indirectly capture exclusive capabilities such as capabilities that control access to mutable state. Typical `Control` capabilities are:
6967

docs/_docs/reference/experimental/cc-how-to-use.md renamed to docs/_docs/reference/experimental/capture-checking/how-to-use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: doc-page
33
title: "How to Use the Capture Checker"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-how-to-use.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/how-to-use.html
55
---
66

77
## Enabling Capture Checking

docs/_docs/reference/experimental/cc-internals.md renamed to docs/_docs/reference/experimental/capture-checking/internals.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
---
22
layout: doc-page
33
title: "Capture Checking Internals"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-internals.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/internals.html
55
---
66

7-
8-
9-
10-
## Capture Checking Internals
11-
127
The capture checker is architected as a propagation constraint solver, which runs as a separate phase after type-checking and some initial transformations.
138

149
Constraint variables stand for unknown capture sets. A constraint variable is introduced

docs/_docs/reference/experimental/cc-polymorphism.md renamed to docs/_docs/reference/experimental/capture-checking/polymorphism.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
layout: doc-page
33
title: "Capability Polymorphism"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-polymorphism.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/polymorphism.html
55
---
66

7-
## Capability Polymorphism
8-
97
It is sometimes convenient to write operations that are parameterized with a capture set of capabilities. For instance consider a type of event sources
108
`Source` on which `Listener`s can be registered. Listeners can hold certain capabilities, which show up as a parameter to `Source`:
119
```scala
@@ -92,4 +90,4 @@ upper bound: `type Cap^ >: {cudaMalloc, cudaFree}`.
9290

9391
----
9492

95-
[More Advanced Use Cases](cc-advanced.md)
93+
[More Advanced Use Cases](advanced.md)

docs/_docs/reference/experimental/cc-scoped-caps.md renamed to docs/_docs/reference/experimental/capture-checking/scoped-caps.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
layout: doc-page
33
title: "Scoped Caps"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-scoped-caps.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/scoped-caps.html
55
---
66

7-
## Scoped Caps
8-
97
When discussing escape checking, we referred to a scoping discipline. That is, capture sets can contain only capabilities that are visible at the point where the set is defined. But that raises the question where a universal capability `cap` is defined? In fact, what is written as the top type `cap` can mean different capabilities, depending on scope. Usually a `cap` refers to a universal capability defined in the scope where the `cap` appears.
108

119
Special rules apply to `cap`s in method and function parameters and results. For example, take this method:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: doc-page
33
title: "Separation Checking"
4-
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/cc-separation-checking.html
4+
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/separation-checking.html
55
---
66

7-
# TODO
7+
## TODO

0 commit comments

Comments
 (0)