mapMaybe package:streaming

The mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result Stream. If it is Just b, then b is included in the result Stream.
Map monadically over a stream, producing a new stream only containing the Just values.