[plt-scheme] Typed-Scheme and call-with-input-file

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Tue Apr 7 13:47:59 EDT 2009

Hi all,

I am trying call-with-input-file and I am getting a very unclear error:
#lang typed-scheme

(: read-char/file (String -> (U Char EOF)))
(define (read-char/file filename)
  (call-with-input-file filename
    (lambda: ((ip : Input-Port))
      (read ip))
    #:mode 'text))

typecheck: Cannot apply expression of type #(struct:tc-result (All (a)
(case-lambda (String ((U Output-Port Input-Port) -> a) -> a) (String
((U Output-Port Input-Port) -> a) Symbol -> a))) ((var #t
read-char/file)) ((var #f read-char/file))), since it is not a
function type in: (call-with-input-file filename (lambda: ((ip :
Input-Port)) (read ip)) #:mode (quote text))

What's the issue here?

Cheers,

-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.