Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am johnthegr8 on github.
  • I am ioannisg (https://keybase.io/ioannisg) on keybase.
  • I have a public key ASBtj_PGh9top0PU1PNj_QoZSvIkl4NMXVXb8xAy6_HLpQo

To claim this, I am signing this object:

@JohnTheGr8
JohnTheGr8 / README.md
Created May 3, 2019 23:57 — forked from mrange/README.md
[F#/OCaml] Implementing a data streams library using a bunch of one-liners

[F#/OCaml] Implementing a data streams library using a bunch of one-liners

A few years ago when I read the presentation motivating the design behind Nessos Streams I was struck by the beauty of simplistic push streams.

type PushStream<'T> = ('T -> bool) -> bool

LINQ (in .NET) is a pull stream, ie we pull values out of the stream by calling MoveNext + Current. One of the problems with pull streams is the constant checking "Are we done?" at each level in the stream.