To implement support for this, you would mostly need to add types for the relevant functions -- but those functions are the ones that generators (or streams) expand to. For generators, the key ones look to be `create-generator` and `yield`. `create-generator` is not exported, so you'd have to add the type in `typed-racket/base-env/base-special-env`. `yield` can be given a type in `typed-racket/base-env/base-env`. The tricky part will be figuring out what those types should be.
I'm happy to answer more questions about adding this. Sam On Wed, Jul 22, 2020 at 3:22 PM Nate Griswold <[email protected]> wrote: > > Ok, thanks for the reply. > > I was trying to use this function: > > (define (iterate f) > (yield (f)) > (iterate f)) > > But it seems the only thing i can do is have a separate (calling it > "-untyped.rkt") module and putting anything that requires iterate in there. > > Are there any papers that would be helpful in trying to address this > implementation-wise? > > Nate > > > On Wed, Jul 22, 2020 at 1:56 PM Sam Tobin-Hochstadt <[email protected]> > wrote: >> >> Currently, neither `racket/stream` nor `racket/generator` are >> supported by Typed Racket, unfortunately. >> >> Sam >> >> On Wed, Jul 22, 2020 at 12:15 AM Nate Griswold <[email protected]> >> wrote: >> > >> > Actually, is there any way at all to use lazy lists of things (streams or >> > generators) in typed racket? >> > >> > Nate >> > >> > >> > On Tue, Jul 21, 2020 at 8:45 PM Nate Griswold <[email protected]> >> > wrote: >> >> >> >> Do generators and typed racket work together well? It seems (yield) >> >> doesn't have a type and i couldn't get my module to work. >> >> >> >> Is there a way to make some procedure untyped in the middle of a typed >> >> file? Is it just best to break these things into separate files? >> >> >> >> Thank you >> >> >> >> Nate >> > >> > -- >> > 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 [email protected]. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msgid/racket-users/CAM-xLPo_c3LzL81Qv6bA2zzJMhQftQ46JR%3DWyZdSJjPJ9rYM5Q%40mail.gmail.com. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BaUGsFS%2B5AdXB3ZGL759EaKqDLgehnpZ1HcTn0FNUvQ0g%40mail.gmail.com.

