This is yet another streaming library for Haskell, created to scratch the following itches:
-
The main type is as simple as possible: the only type parameter is the type of the yielded elements.
-
The
Monoid
/Alternative
/MonadPlus
methods perform concatenation, just like with regular lists. TheFunctor
Applicative
andMonad
instances also resemble those of lists. -
There are direct analogues of functions like
withFile
,bracket
,finally
andonError
that easy to integrate in a streaming pipeline, and behave smartly when combined with functions liketake
. -
Compatible with the foldl library for collector-like terminal operations. (All self-respecting streaming libraries must have this.)
In order to achieve those objectives, the following sacrifices have been made:
-
No flexibility in the underlying monad for the stream effects: it's always
IO
. -
No separate "channels" that return extra information at the end of the stream. This means exceptions are the only way of signalling errors or unexpected conditions.
-
Elements in a stream can't be "extracted" one by one in a pull-based way, like you can do for example in streaming.
-
There's
take
anddrop
, but not at propersplitAt
. Also, grouping operations are cumbersome and underpowered, especially compared to libraries like streaming or streaming-bytestring.
I haven't run any benchmarks, but you can safely assume that this library will move like a snail compared to streamly's Ferrari.
-
turtle. The
Shell
type resemblesJet
. One possible difference is thatShell
doesn't seem to provide a way for theShell
consumer to signal that no further values are needed, at least judging from the docs for limit."turtle" also inspired the idea of having a separate type for lines.
-
streamly. I might have reinvented a subset of streamly (but worse).
-
Z.IO.BIO from Z-IO. Like
Jet
, uses a callback-transformation approach. -
The Stream type from Java is somewhat similar to this library's
Jet
. (And the foldl library would be the analogue of Collectors.)