streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Change the stream construction operators

Open harendra-kumar opened this issue 7 years ago • 1 comments

Currently we use .: for pure stream construction and |: for monadic stream construction. I am contemplating on changing these and using this scheme:

Pure list: 1 :> 2 :> Nil for 1 `Cons` 2 `Cons` Nil
Pure stream: 1 >: 2 >: nil for 1 `cons` 2 `cons` nil
Monadic stream: getLine >>: getLine >>: nil for `getLine `consM` getLine `consM` nil

I especially like the >>: as it is a hybrid of the monadic bind >> and list construction : and therefore a natural choice for monadic list.

harendra-kumar avatar Nov 26 '18 06:11 harendra-kumar

We can also use :< for pure list, symmetrically opposite to pure stream.

harendra-kumar avatar Nov 28 '18 09:11 harendra-kumar