Skip to content

Commit e18cc30

Browse files
committed
Tweaks to cc docs
The first paragraph of a doc page is rendered as some sort of synopsis/subtitle, which looked awkward with the current text. This change adds introduction headings, which also improves the navigation on the right-hand side of a page.
1 parent 948307d commit e18cc30

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ title: "Capture Checking"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/cc.html
55
---
66

7-
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
7+
Capture checking is a research project that modifies the Scala type system to track references to capabilities in values.
8+
9+
## Introduction
10+
11+
Capture checking can be enabled by the language import
812
```scala
913
import language.experimental.captureChecking
1014
```

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: "Checked Exceptions"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/checked-exceptions.html
55
---
66

7+
## Introduction
8+
79
Scala enables checked exceptions through a language import. Here is an example,
810
taken from the [safer exceptions page](../canthrow.md), and also described in a
911
[paper](https://infoscience.epfl.ch/record/290885) presented at the

docs/_docs/reference/experimental/capture-checking/classes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: "Capture Checking of Classes"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/classes.html
55
---
66

7+
## Introduction
78

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

docs/_docs/reference/experimental/capture-checking/classifiers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: "Capability Classifiers"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/classifiers.html
55
---
66

7+
## Introduction
8+
79
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.
810

911
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

docs/_docs/reference/experimental/capture-checking/polymorphism.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: "Capability Polymorphism"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/polymorphism.html
55
---
66

7+
## Introduction
8+
79
It is sometimes convenient to write operations that are parameterized with a capture set of capabilities. For instance consider a type of event sources
810
`Source` on which `Listener`s can be registered. Listeners can hold certain capabilities, which show up as a parameter to `Source`:
911
```scala

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: "Scoped Caps"
44
nightlyOf: https://docs.scala-lang.org/scala3/reference/experimental/capture-checking/scoped-caps.html
55
---
66

7+
## Introduction
8+
79
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.
810

911
Special rules apply to `cap`s in method and function parameters and results. For example, take this method:

0 commit comments

Comments
 (0)