I get the message readspec.rkt:195:8: Type Checker: Expression should produce 3 values, but produces 1 values of types String in: (for/set : (Setof String) (((l : String) (cast (in-lines input-port) (Sequenceof String)))) (cast (string-trim l) String))
from the following function: (define (read-manpages [input-port : Input-Port]) (cast (for/set : (Setof String) (([l : String] (cast (in-lines input-port) (Sequenceof String)))) (cast (string-trim l) String)) (Setof String))) The expression it is complaining about is the (for/list ......) construction. I'm trying to covert a Racket program to a typed Racket program. As far as I can see, this function reads words, one to a line, from input-port and makes a set of these words. It baffles me where the type checker gets the idea that 3 values are wanted anywhere. I put in a lot of casts just to make sure I knew what types it had to work with. The original code, without types: (define (read-manpages input-port) (for/set ((l (in-lines input-port))) (string-trim l))) Any ideas? -- hendrik -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20200509153840.ebbxgpzazrhdbldq%40topoi.pooq.com.