typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

The `racket' language does not seem to have a type for this identifier; for stream->list

Open ailrk opened this issue 5 years ago • 4 comments

What version of Racket are you using?

Racket v7.7

What program did you run?

(stream->list (in-range 0 3))

What should have happened?

return '(0 1 2)

If you got an error message, please include it here.

> (stream->list (in-range 0 3))                                     
; readline-input:14:1: Type Checker: missing type for identifier;
; The `racket' language does not seem to have a type for this identifier;
;   please file a bug report identifier: stream->list
;   from module: (lib typed/racket)
;   in: stream->list

ailrk avatar Sep 08 '20 09:09 ailrk

In the meantime, you can use sequence->list.

jackfirth avatar Sep 10 '20 01:09 jackfirth

This stopgap won't work for a usecase I have in mind, since (stream? empty-sequence) returns #f and I'm typing something that relies on racket/stream. Just a note.

Lazerbeak12345 avatar Jan 26 '23 19:01 Lazerbeak12345

Why wouldn't sequence->list work? All streams are sequences, right? So (stream? empty-sequence) shouldn't be necessary. (sequence? empty-stream) would be necessary instead, and that's fine because it's true.

AlexKnauth avatar Feb 02 '23 19:02 AlexKnauth

(we actually talked through this on discord. I'm just writing this here so others aren't confused)

The problem was defining a type for a function that takes a stream as an argument. Using the Sequenceof type should be sufficient as a workaround in the short-term.

Lazerbeak12345 avatar Feb 02 '23 19:02 Lazerbeak12345