simple-flatten‘s argument is a stream whose elements are either the empty stream or a singleton stream. We need to filter out elements that are the empty stream and then take the first element of each resulting stream.
(define (simple-flatten stream) (stream-map stream-car (stream-filter (λ (s) (not (stream-null? s))) stream)))
b) There is no difference in behaviour (as long as Alyssa’s assertions are correct.)