Add more events to the base type environment
Notably the following are not supported yet: - `filesystem-change-evt` (likely needs separate base type) - `port-progress-evt` (separate type, and how do you handle `port-provides-progress-evts?`?) - all other events that rely on progress events Also, the events from racket/port don't work yet due to a strange bug with bindings that have contracts imported into TR's base environment
This commit is contained in:
parent
c911109b55
commit
ace226d506
|
@ -326,8 +326,8 @@
|
||||||
[channel-get (-poly (a) ((-channel a) . -> . a))]
|
[channel-get (-poly (a) ((-channel a) . -> . a))]
|
||||||
[channel-try-get (-poly (a) ((-channel a) . -> . (Un a (-val #f))))]
|
[channel-try-get (-poly (a) ((-channel a) . -> . (Un a (-val #f))))]
|
||||||
[channel-put (-poly (a) ((-channel a) a . -> . -Void))]
|
[channel-put (-poly (a) ((-channel a) a . -> . -Void))]
|
||||||
|
[channel-put-evt (-poly (a) (-> (-channel a) a (-mu x (make-Evt x))))]
|
||||||
|
[channel-put-evt? (make-pred-ty (-mu x (make-Evt x)))]
|
||||||
|
|
||||||
;Section 3.3
|
;Section 3.3
|
||||||
|
|
||||||
|
@ -501,11 +501,9 @@
|
||||||
|
|
||||||
;Section 10.1.3
|
;Section 10.1.3
|
||||||
[thread-wait (-Thread . -> . -Void)]
|
[thread-wait (-Thread . -> . -Void)]
|
||||||
|
[thread-dead-evt (-> -Thread (-mu x (make-Evt x)))]
|
||||||
;TODO need event types
|
[thread-resume-evt (-> -Thread (-mu x (make-Evt x)))]
|
||||||
;thread-dead-evt
|
[thread-suspend-evt (-> -Thread (-mu x (make-Evt x)))]
|
||||||
;thread-resume-evt
|
|
||||||
;thread-suspend-evt
|
|
||||||
|
|
||||||
;Section 10.1.4
|
;Section 10.1.4
|
||||||
[thread-send
|
[thread-send
|
||||||
|
@ -514,6 +512,7 @@
|
||||||
(-> -Thread Univ (-> a) (Un -Void a))))]
|
(-> -Thread Univ (-> a) (Un -Void a))))]
|
||||||
[thread-receive (-> Univ)]
|
[thread-receive (-> Univ)]
|
||||||
[thread-try-receive (-> Univ)]
|
[thread-try-receive (-> Univ)]
|
||||||
|
[thread-receive-evt (-> (-mu x (make-Evt x)))]
|
||||||
[thread-rewind-receive (-> (-lst Univ) -Void)]
|
[thread-rewind-receive (-> (-lst Univ) -Void)]
|
||||||
|
|
||||||
;Section 10.3.1 (Thread Cells)
|
;Section 10.3.1 (Thread Cells)
|
||||||
|
@ -1530,6 +1529,10 @@
|
||||||
[tcp-close (-TCP-Listener . -> . -Void)]
|
[tcp-close (-TCP-Listener . -> . -Void)]
|
||||||
[tcp-listener? (make-pred-ty -TCP-Listener)]
|
[tcp-listener? (make-pred-ty -TCP-Listener)]
|
||||||
|
|
||||||
|
[tcp-accept-evt
|
||||||
|
(-> -TCP-Listener
|
||||||
|
(make-Evt (-pair -Input-Port (-pair -Output-Port (-val '())))))]
|
||||||
|
|
||||||
[tcp-abandon-port (-Port . -> . -Void)]
|
[tcp-abandon-port (-Port . -> . -Void)]
|
||||||
[tcp-addresses (cl->*
|
[tcp-addresses (cl->*
|
||||||
(-Port [(-val #f)] . ->opt . (-values (list -String -String)))
|
(-Port [(-val #f)] . ->opt . (-values (list -String -String)))
|
||||||
|
@ -1562,19 +1565,21 @@
|
||||||
[udp-bound? (-> -UDP-Socket B)]
|
[udp-bound? (-> -UDP-Socket B)]
|
||||||
[udp-connected? (-> -UDP-Socket B)]
|
[udp-connected? (-> -UDP-Socket B)]
|
||||||
|
|
||||||
|
[udp-send-ready-evt (-> -UDP-Socket (-mu x (make-Evt x)))]
|
||||||
|
[udp-receive-ready-evt (-> -UDP-Socket (-mu x (make-Evt x)))]
|
||||||
|
[udp-send-to-evt (->opt -UDP-Socket -String -Nat -Bytes [-Nat -Nat]
|
||||||
|
(make-Evt -Void))]
|
||||||
|
[udp-send-evt (->opt -UDP-Socket -Bytes [-Nat -Nat]
|
||||||
|
(make-Evt -Void))]
|
||||||
|
[udp-receive!-evt
|
||||||
|
(->opt -UDP-Socket -Bytes [-Nat -Nat]
|
||||||
|
(make-Evt (-pair -Nat (-pair -String (-pair -Nat (-val null))))))]
|
||||||
|
|
||||||
[udp-addresses
|
[udp-addresses
|
||||||
(cl->*
|
(cl->*
|
||||||
(->opt -UDP-Socket [(-val #f)] (-values (list -String -String)))
|
(->opt -UDP-Socket [(-val #f)] (-values (list -String -String)))
|
||||||
(-> -UDP-Socket (-val #t) (-values (list -String -NonNegFixnum -String -NonNegFixnum))))]
|
(-> -UDP-Socket (-val #t) (-values (list -String -NonNegFixnum -String -NonNegFixnum))))]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; racket/path
|
;; racket/path
|
||||||
|
|
||||||
[explode-path (-SomeSystemPathlike . -> . (-lst (Un -SomeSystemPath (one-of/c 'up 'same))))]
|
[explode-path (-SomeSystemPathlike . -> . (-lst (Un -SomeSystemPath (one-of/c 'up 'same))))]
|
||||||
|
@ -2190,10 +2195,11 @@
|
||||||
[semaphore-wait (-> -Semaphore -Void)]
|
[semaphore-wait (-> -Semaphore -Void)]
|
||||||
[semaphore-try-wait? (-> -Semaphore B)]
|
[semaphore-try-wait? (-> -Semaphore B)]
|
||||||
[semaphore-wait/enable-break (-> -Semaphore -Void)]
|
[semaphore-wait/enable-break (-> -Semaphore -Void)]
|
||||||
|
[semaphore-peek-evt (-> -Semaphore (-mu x (make-Evt x)))]
|
||||||
|
[semaphore-peek-evt? (make-pred-ty (-mu x (make-Evt x)))]
|
||||||
;[call-with-semaphore ???]
|
;[call-with-semaphore ???]
|
||||||
;[call-with-semaphore/enable-break ???]
|
;[call-with-semaphore/enable-break ???]
|
||||||
|
|
||||||
|
|
||||||
;Section 17.2 (Libraries and Collections)
|
;Section 17.2 (Libraries and Collections)
|
||||||
[find-library-collection-paths (->opt [(-lst -Pathlike) (-lst -Pathlike)] (-lst -Path))]
|
[find-library-collection-paths (->opt [(-lst -Pathlike) (-lst -Pathlike)] (-lst -Path))]
|
||||||
[collection-file-path (->* (list -Pathlike) -Pathlike -Path)]
|
[collection-file-path (->* (list -Pathlike) -Pathlike -Path)]
|
||||||
|
@ -2262,6 +2268,7 @@
|
||||||
[close-output-port (-> -Output-Port -Void)]
|
[close-output-port (-> -Output-Port -Void)]
|
||||||
|
|
||||||
[port-closed? (-> -Port B)]
|
[port-closed? (-> -Port B)]
|
||||||
|
[port-closed-evt (-> -Port (-mu x (make-Evt x)))]
|
||||||
|
|
||||||
[current-input-port (-Param -Input-Port -Input-Port)]
|
[current-input-port (-Param -Input-Port -Input-Port)]
|
||||||
[current-output-port (-Param -Output-Port -Output-Port)]
|
[current-output-port (-Param -Output-Port -Output-Port)]
|
||||||
|
@ -2446,15 +2453,21 @@
|
||||||
|
|
||||||
;12.1.10.3
|
;12.1.10.3
|
||||||
|
|
||||||
;eof-evt
|
[eof-evt (-> -Input-Port (make-Evt (-val eof)))]
|
||||||
;read-bytes-evt
|
[read-bytes-evt (-> -Nat -Input-Port (make-Evt (Un -Bytes (-val eof))))]
|
||||||
;read-bytes!-evt
|
;read-bytes!-evt (need progress event support)
|
||||||
;read-bytes-avail!-evt
|
[read-bytes-avail!-evt
|
||||||
;read-string-evt
|
(-> -Bytes -Input-Port (make-Evt (Un -Nat (-val eof))))]
|
||||||
;read-string!-evt
|
[read-string-evt (-> -Nat -Input-Port (make-Evt (Un -String (-val eof))))]
|
||||||
;read-line-evt
|
[read-string!-evt (-> -String -Input-Port (make-Evt (Un -Nat (-val eof))))]
|
||||||
;read-bytes-line-evt
|
[read-line-evt (-> -Input-Port
|
||||||
;peek-bytes-evt
|
(one-of/c 'linefeed 'return 'return-linefeed 'any 'any-one)
|
||||||
|
(make-Evt (Un -String (-val eof))))]
|
||||||
|
[read-bytes-line-evt
|
||||||
|
(-> -Input-Port
|
||||||
|
(one-of/c 'linefeed 'return 'return-linefeed 'any 'any-one)
|
||||||
|
(make-Evt (Un -Bytes (-val eof))))]
|
||||||
|
;peek-bytes-evt (ditto progress event)
|
||||||
;peek-bytes!-evt
|
;peek-bytes!-evt
|
||||||
;peek-bytes-avail!-evt
|
;peek-bytes-avail!-evt
|
||||||
;peek-string-evt
|
;peek-string-evt
|
||||||
|
@ -2729,6 +2742,7 @@
|
||||||
#:named (Un (-val #f) -Symbol) #f
|
#:named (Un (-val #f) -Symbol) #f
|
||||||
-Place)]
|
-Place)]
|
||||||
[place-wait (-> -Place -Int)]
|
[place-wait (-> -Place -Int)]
|
||||||
|
[place-dead-evt (-> -Place (make-Evt -Byte))]
|
||||||
[place-break (-> -Place -Void)]
|
[place-break (-> -Place -Void)]
|
||||||
[place-kill (-> -Place -Void)]
|
[place-kill (-> -Place -Void)]
|
||||||
[place-channel (-> (-values (list -Place-Channel -Place-Channel)))]
|
[place-channel (-> (-values (list -Place-Channel -Place-Channel)))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user