From 501766dde08bfd9ee1d1d257ae8baa76133581e6 Mon Sep 17 00:00:00 2001 From: Noel Welsh Date: Fri, 26 Mar 2010 14:48:33 +0000 Subject: [PATCH] Add types for most of Byte and String Output (Section 12.3 of the Reference). Only functions that need an Event type (i.e. matching evt?) are missing. They are commented out as a placeholder for future additions. svn: r18628 original commit: 302555cf0154206242d6f72f1a5572f76a16f536 --- collects/typed-scheme/private/base-env.ss | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/collects/typed-scheme/private/base-env.ss b/collects/typed-scheme/private/base-env.ss index 8a120f92..0c2b5c9d 100644 --- a/collects/typed-scheme/private/base-env.ss +++ b/collects/typed-scheme/private/base-env.ss @@ -704,3 +704,40 @@ ;; mutable pairs + + +;; Byte and String Output (Section 12.3 of the Reference) +[write-char (cl-> [(-Char) -Void] + [(-Char -Output-Port) -Void])] +[write-byte (cl-> [(-Nat) -Void] + [(-Nat -Output-Port) -Void])] +[newline (cl-> [() -Void] + [(-Output-Port) -Void])] +[write-string (cl-> [(-String) -Nat] + [(-String -Output-Port) -Nat] + [(-String -Output-Port -Nat) -Nat] + [(-String -Output-Port -Nat -Nat) -Nat])] +[write-bytes (cl-> [(-Bytes) -Nat] + [(-Bytes -Output-Port) -Nat] + [(-Bytes -Output-Port -Nat) -Nat] + [(-Bytes -Output-Port -Nat -Nat) -Nat])] +[write-bytes-avail (cl-> [(-Bytes) -Nat] + [(-Bytes -Output-Port) -Nat] + [(-Bytes -Output-Port -Nat) -Nat] + [(-Bytes -Output-Port -Nat -Nat) -Nat])] +[write-bytes-avail* (cl-> [(-Bytes) (-opt -Nat)] + [(-Bytes -Output-Port) (-opt -Nat)] + [(-Bytes -Output-Port -Nat) (-opt -Nat)] + [(-Bytes -Output-Port -Nat -Nat) (-opt -Nat)])] +[write-bytes-avail/enable-break (cl-> [(-Bytes) -Nat] + [(-Bytes -Output-Port) -Nat] + [(-Bytes -Output-Port -Nat) -Nat] + [(-Bytes -Output-Port -Nat -Nat) -Nat])] +[write-special (cl-> [(Univ) -Boolean] + [(Univ -Output-Port) -Boolean])] +;; Need event type before we can include these +;;write-special-avail* +;;write-bytes-avail-evt +;;write-special-evt +[port-writes-atomic? (-Output-Port . -> . -Boolean)] +[port-writes-special? (-Output-Port . -> . -Boolean)]