composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
856 stars 64 forks source link

Avoid exposing nilM, use "before" instead? #1138

Open harendra-kumar opened 3 years ago

harendra-kumar commented 3 years ago

This issue is only as a note to remember. We have not exposed nilM yet.

before action Stream.nil can be used in place of nilM.

We could express before in terms of nilM too (before action xs = nilM action <> xs) but the advantage of using before is that it can fully fuse whenever possible.

adithyaov commented 2 years ago

Is there a reason to not use nilM? Too many options lead to confusion. If before action nil and nilM are exactly the same, we might as well remove nilM.