File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
typed-racket-doc/typed-racket/scribblings/reference
typed-racket-lib/typed-racket Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,17 @@ is a subtype of @racket[(Read-Only-Boxof b)] if @racket[a] is a subtype of @rack
368
368
(set-box! b 5 )
369
369
(unbox b-read-only)]
370
370
371
+ @defform[(Boxof/Write-Read write-t read-t)]{
372
+ A @rtech{box} that supports write operations like @racket[set-box!]
373
+ taking @racket[write-t], and read operations like @racket[unbox]
374
+ returning @racket[read-t]. For this type to make sense,
375
+ @racket[write-t] should be a subtype of @racket[read-t].
376
+
377
+ The type @racket[(Boxof t)] is equivalent to
378
+ @racket[(Boxof/Write-Read t t)], and the type
379
+ @racket[(Read-Only-Boxof t)] is equivalent to
380
+ @racket[(Boxof/Write-Read Nothing t)].}
381
+
371
382
@defidform[BoxTop]{is the type of a @rtech{box} with an unknown element
372
383
type and is the supertype of all box types. Only read-only box operations
373
384
(e.g. @racket[unbox]) are allowed on values of this type. This type
Original file line number Diff line number Diff line change 173
173
[Pair (-poly (a b) (-pair a b))]
174
174
[Boxof (-poly (a) (-box a))]
175
175
[Read-Only-Boxof (-poly (a) (-Read-Only-Boxof a))]
176
+ [Boxof/Write-Read (-poly (w r) (-box w r))]
176
177
[Weak-Boxof (-poly (a) (-weak-box a))]
177
178
[Channelof (-poly (a) (make-Channel a))]
178
179
[Async-Channelof (-poly (a) (make-Async-Channel a))]
Original file line number Diff line number Diff line change 452
452
[(HeterogeneousVector: e) `(Vector ,@(map t->s e))]
453
453
[(Box: e e) `(Boxof ,(t->s e))]
454
454
[(Box: (Union: '() ) e) `(Read-Only-Boxof ,(t->s e))]
455
+ [(Box: e1 e2) `(Boxof/Write-Read ,(t->s e1) ,(t->s e2))]
455
456
[(Weak-Box: e) `(Weak-Boxof ,(t->s e))]
456
457
[(Future: e) `(Futureof ,(t->s e))]
457
458
[(Channel: e) `(Channelof ,(t->s e))]
You can’t perform that action at this time.
0 commit comments