Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are streams in ocaml really used?

Looking at different ocaml projects, I don't see the built-in Streams in the language ever used. Even in the recent Real World Ocaml book, Streams are not mentioned at all, which is odd.

What's the reason for that? Is it because Lwt or Core superseed them?

like image 452
Sergi Mansilla Avatar asked May 12 '15 17:05

Sergi Mansilla


2 Answers

I think I pretty much answer this question in this bug report.

like image 55
Drup Avatar answered Nov 18 '22 18:11

Drup


Streams were quite good with camlp4 syntax support, without it they are hardly usable at all. So, this was in times long past (although it is still usable, theoretically). As per Drup's reference they would be even removed in a near future (this year) from the core language, and, presumably, will be moved to a standalone library.

This is all not to say, that there is something wrong with streams as a data structure. This is still a very valuable technique used in many OCaml projects, they just use different libraries that implement this. There is Core Sequence, Batteries Enum, Simon Cruanes's gen and sequence packages, Joseph Abrahamson's fstream package to name a few.

like image 2
ivg Avatar answered Nov 18 '22 19:11

ivg