Skip to content

Commit 9eae49c

Browse files
committed
fix documentation, (Boxof/Read t) is a supertype of (Boxof t)
1 parent 4358b8c commit 9eae49c

File tree

1 file changed

+12
-6
lines changed
  • typed-racket-doc/typed-racket/scribblings/reference

1 file changed

+12
-6
lines changed

typed-racket-doc/typed-racket/scribblings/reference/types.scrbl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,13 @@ corresponding to @racket[trest], where @racket[bound]
367367

368368
@defform[(Boxof/Read t)]{
369369
A @rtech{box} of @racket[t] that only supports read-only operations
370-
such as @racket[unbox]. A @racket[(Boxof/Read t)] is a subtype of
371-
@racket[(Boxof t)], and a @racket[(Boxof/Read a)] is a subtype of
372-
@racket[(Boxof/Read b)] if @racket[a] is a subtype of @racket[b]. It
373-
is equivalent to @racket[(Boxof Nothing t)].}
370+
such as @racket[unbox]. A @racket[(Boxof/Read a)] is a subtype of
371+
@racket[(Boxof/Read b)] if @racket[a] is a subtype of @racket[b].
372+
373+
A @racket[(Boxof/Read t)] is a supertype of @racket[(Boxof t)], so
374+
any @racket[(Boxof t)] can be used as a @racket[(Boxof/Read t)], but
375+
but not the other way around. It is equivalent to
376+
@racket[(Boxof Nothing t)].}
374377

375378
@ex[(box-immutable "hello world")
376379
(code:comment "though this does not necessarily imply immutability:")
@@ -384,8 +387,11 @@ corresponding to @racket[trest], where @racket[bound]
384387
@defform[(Boxof/Write t)]{
385388
A @rtech{box} that could contain anything, but can only take
386389
@racket[t] for write operations such as @racket[set-box!].
387-
A @racket[(Boxof/Write t)] is a supertype of @racket[(Boxof t)], and
388-
it is equivalent to @racket[(Boxof t Any)].}
390+
391+
A @racket[(Boxof/Write t)] is a supertype of @racket[(Boxof t)], so
392+
a @racket[(Boxof t)] can be used as a @racket[(Boxof/Write t)], but
393+
but not the other way around. It is equivalent to
394+
@racket[(Boxof t Any)].}
389395

390396
@defidform[BoxTop]{is the type of a @rtech{box} with an unknown element
391397
type and is the supertype of all box types. Only read-only box operations

0 commit comments

Comments
 (0)