Skip to content

Commit 6cab0aa

Browse files
committed
Small improvements
1 parent bf88646 commit 6cab0aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

jane/doc/extensions/kinds/index.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Basic kinds have the form:
5050

5151
For example, the type `(int -> int) option` has the kind `value mod contended
5252
immutable non_float`. Here, the layout `value` indicates that members of this
53-
type have the shape of normal OCaml data (and can be garbage collected), and the
53+
type have the shape of normal OCaml data, and the
5454
bounds `contended immutable` indicates that they can safely ignore the
5555
*contention* (any value of this type can be treated as if it were created in the
5656
current thread) and *visibility* axes (no part of this type is mutable, and so
@@ -127,8 +127,7 @@ stateless <= value mod observing`, and bounding by the maximum mode has no
127127
effect. However, along the past modal axes, a _higher_ mode leads to a lower
128128
kind. So `value mod contended <= value mod sharing` and bounding by the minimum
129129
mode has no effect. We can think of the past axes as flipped, when used in a
130-
kind. This is because `value mod contended` is more restrictive (describes fewer
131-
types) than `value mod sharing`, and so we must flip these past axes (somewhat
130+
kind. This is because `value mod contended` is more restrictive than `value mod sharing` (the former contains types that do not care at all about the value of the contention axis, while the latter contains types that still care about the distinction between `contended` and `sharing`/`uncontended`), and so we must flip these past axes (somewhat
132131
unfortunately).
133132

134133
If you want to get nerdy about it, each individual piece of a kind (the layout

jane/doc/extensions/kinds/syntax.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ end
344344
```
345345

346346
The kind chosen for `'a t` in the signature is `value` (as described below), and
347-
thus inferring `'a : any` in the signature would not be safe: it would allow us
348-
to smuggle, say, a `float64` type where only `value`s are expected.
347+
thus inferring `'a : any` in the signature (and then accepting the module
348+
inclusion) would not be safe: it would allow us to smuggle, say, a `float64`
349+
type where only `value`s are expected.
349350

350351
Accordingly, all type parameters are assumed to have a layout other than `any`
351352
and also bounded by `non_null` -- unless you write a kind annotation saying
@@ -356,8 +357,8 @@ annotation is not ignored, but instead causes the initial assumed kind of `'a`
356357
to be `any`, allowing that kind to be lowered by usages of `'a`.
357358

358359
If type inference ends and we still do not know what layout should be used for
359-
the parameter (this can happen only without an annotation), we default the
360-
layout to `value_non_null`.
360+
the parameter (this can happen only without an annotation), we infer the
361+
kind `value`.
361362

362363
Abstract types are treated identically to concrete ones; it's just that abstract
363364
types have no right-hand side to use to perform inference, and so an unnanotated

0 commit comments

Comments
 (0)