I've pushed a fix for this, but I see that many other things don't work right along these lines. For example, vectorness is not preserved and probably none of the things except listness is preserved (from the list of things here http://docs.racket-lang.org/reference/sequences.html).
It's not too hard to add that list of things to the contract combinator, of course, but maybe there should be a chaperone construct and perhaps even something added directly to the sequence api, to support that. Robby On Mon, Apr 6, 2015 at 10:50 PM, Alexander D. Knauth <alexan...@knauth.org> wrote: > I was running into a problem with using streams in typed racket, where I was > using the Sequenceof type to represent streams, and they got turned into > non-stream sequences, which don’t work for stream-specific operations. > > I think what's causing it is this: > #lang racket > (define/contract my-stream > (sequence/c any/c) > (stream 1 2 3)) > (stream? my-stream) > This produces #f. > > While I can sort of understand why it’s doing this, would it make sense to > change this so that it keeps it a stream? > > It seems like most of the other sequence operations specify that they > preserve stream-ness, so is there any reason this doesn’t? > > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.