All right, here we go! The API is quite a bit different than what we have currently, but it's simpler to use, more general, and the implementation can be much more efficient. The encoding for Tee
, Process1
, Channel
is greatly simplified, these become just regular functions, rather than a Process[F,_]
with a funky F
. Stepping a Process
is now a first-class concept, exposed publicly, in a safe way. The resulting style looks a lot like ordinary list processing, and doing things like a 3-way or N-way merge are trivial.
The algebra and the canonical model for this algebra are given in the attached streams.scala
. The algebra for streams is given by the trait Stream[P[+_[_],+_]]
, and there's a canonical instance, Stream[NF]
, which specifies what the operations mean. A couple notes:
- The
Process[F,A]
data type we have currently would have aStream
instance. (Name ofStream
TBD) - The
Chunk
type is TBD Free
is just the free monad (well, one formulation of it)- I still have some uncert