Open AlexXanderGrib opened 1 year ago
Hi @AlexXanderGrib.
Thank you for the proposal, it looks great.
I want to know a little bit more about the use cases of each bullet because it's hard to understand, why people should have an iterator for Maybe
or Either
.
Could you describe a few use cases inside each paragraph?
Hello @JSMonk, haven't used @sweet-monads/iterator
, all proposed iterator features implemented there
Hello, while @JSMonk was away this spring i created my fork of this library. Here it is https://github.com/AlexXanderGrib/monads-io
And here some good ideas you can grab from it:
1. Use inheritance
It's simpler. Types can now be defined as:
It's more efficient. Now left and right are different on class level, so difference is expressed through prototype without specific property, so overhead is minimal
2. Make
None
a singletonContinuing with classes, it is possible to create one and only one None for all program
3. Create rust-like iterator helpers
4. Add
await
method for async monads5. Add
zip
methodCan be used to refactor
.apply()