Stream (abstract data type)
This article needs additional citations for verification. (February 2020) |
In type theory and functional programming, a stream is a potentially infinite analog of a list, given by the coinductive definition:[1][2]
data Stream α = Nil | Cons α (Stream α)
Generating and computing with streams requires lazy evaluation, either implicitly in a lazily evaluated language or by creating and forcing thunks in an eager language. In total languages they must be defined as codata and can be iterated over using (guarded) corecursion.

Java provides the Stream interface under the java.util.stream namespace.
JavaScript provides the ReadableStream, WritableStream and TransformStream interfaces.[3]
Python have the StreamReader and StreamWriter classes in the asyncio module.[4]
.NET provides the abstract class Stream[5] which is implemented by classes such as FileStream and MemoryStream.[6]
In Rust a struct can implement the Read trait.[7] There is also the Cursor struct wraps an in-memory buffer.[8]
See also
References
- ^ Yamagiwa, Shinichi (2022), Katoh, Naoki; Higashikawa, Yuya; Ito, Hiro; Nagao, Atsuki (eds.), "Stream-Based Lossless Data Compression", Sublinear Computation Paradigm: Algorithmic Revolution in the Big Data Era, Singapore: Springer, pp. 391–410, doi:10.1007/978-981-16-4095-7_16, ISBN 978-981-16-4095-7
{{citation}}: CS1 maint: work parameter with ISBN (link) - ^ Sangma, Jerry W.; Sarkar, Mekhla; Pal, Vipin; Agrawal, Amit; Yogita (2022-04-01). "Hierarchical clustering for multiple nominal data streams with evolving behaviour". Complex & Intelligent Systems. 8 (2): 1737–1761. doi:10.1007/s40747-021-00634-0. ISSN 2198-6053.
- ^ "Streams API - Web APIs | MDN". developer.mozilla.org. 26 July 2024. Retrieved 28 January 2025.
- ^ "Streams". Python documentation. Retrieved 17 December 2024.
- ^ "Stream Class (System.IO)". learn.microsoft.com. Microsoft. Retrieved 17 December 2024.
- ^ "File and Stream I/O - .NET". learn.microsoft.com. Microsoft. 15 September 2021. Retrieved 17 December 2024.
- ^ "Read in std::io - Rust". doc.rust-lang.org. Retrieved 28 January 2025.
- ^ "Cursor in std::io - Rust". doc.rust-lang.org. Retrieved 28 January 2025.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.