From b644ec7be4c77e5b0ac8c66a1bc10283856447a9 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 14 Jun 2010 17:23:42 -0400 Subject: [PATCH] fix types of `read' functions --- collects/typed-scheme/private/base-env.rkt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/collects/typed-scheme/private/base-env.rkt b/collects/typed-scheme/private/base-env.rkt index e64f085218..11f7a99265 100644 --- a/collects/typed-scheme/private/base-env.rkt +++ b/collects/typed-scheme/private/base-env.rkt @@ -190,7 +190,7 @@ 'must-truncate 'truncate/replace) #f -Output-Port)] -[read (->opt [-Input-Port] -Sexp)] +[read (->opt [-Input-Port] (Un -Sexp (-val eof)))] [ormap (-polydots (a c b) (->... (list (->... (list a) (b b) c) (-lst a)) ((-lst b) b) c))] [andmap (-polydots (a c d b) (cl->* ;; 1 means predicate on second argument @@ -567,7 +567,6 @@ ((-HT a b) -Integer . -> . a))] [hash-iterate-value (-poly (a b) ((-HT a b) -Integer . -> . b))] -#;[hash-table-index (-poly (a b) ((-HT a b) a b . -> . -Void))] [bytes (->* (list) -Integer -Bytes)] [make-bytes (cl-> [(-Integer -Integer) -Bytes] @@ -579,11 +578,11 @@ [bytes-length (-> -Bytes -Nat)] [unsafe-bytes-length (-> -Bytes -Nat)] -[read-bytes-line (->opt [-Input-Port Sym] -Bytes)] +[read-bytes-line (->opt [-Input-Port Sym] (Un -Bytes (-val eof)))] [open-input-file (->key -Pathlike #:mode (Un (-val 'binary) (-val 'text)) #f -Input-Port)] [close-input-port (-> -Input-Port -Void)] [close-output-port (-> -Output-Port -Void)] -[read-line (->opt [-Input-Port Sym] -String)] +[read-line (->opt [-Input-Port Sym] (Un -String (-val eof)))] [copy-file (-> -Pathlike -Pathlike -Void)] [flush-output (->opt [-Output-Port] -Void)] [file-stream-buffer-mode (cl-> [(-Port) (Un (-val 'none) (-val 'line) (-val 'block) (-val #f))] @@ -613,11 +612,8 @@ [char-ready? (->opt [-Input-Port] B)] [byte-ready? (->opt [-Input-Port] B)] -#;[exn:fail? (-> Univ B)] -#;[exn:fail:read? (-> Univ B)] - [open-output-string (-> -Output-Port)] -;; FIXME - wrong +;; FIXME - this is too general [get-output-string (-> -Output-Port -String)] [make-directory (-> -Path -Void)]