preprint: Elements of stream calculus