jklmli / monapt

Options, Tries, and Futures for JavaScript / TypeScript
MIT License
172 stars 13 forks source link

Fantasy land support #13

Open mnn opened 7 years ago

mnn commented 7 years ago

This library looks nice (I like Scala, so that may be the reason :grinning:). I recommend to take a look at fantasy-land and consider implementing support for it (if it is possible, I really don't understand it that well). monapt cound be then used with fantasy-land-compatible libraries like quite popular ramda.

jklmli commented 7 years ago

Interesting, I've heard of fantasy-land before but not ramda. I don't have much experience with either tool though.

Maybe someone else can weigh in on if it's useful/possible to implement a small subset on the fantasy-land spec. If so, we could consider adding a fantasy-land wrapper API on top of the current monapt API.

OliverJAsh commented 7 years ago

👍 , this would be useful. For example, if I wanted to use Ramda’s sequence.

OliverJAsh commented 7 years ago

Other "Maybe/Option in JS" libraries that do provide fantasy-land compatibility;

jklmli commented 7 years ago

Dug into this a little more - here are the relevant specs I found:

jklmli commented 7 years ago

IIRC protected methods in TypeScript aren't actually hidden, so we might be able to support fantasy-land compatibility without changing the public API.

jklmli commented 7 years ago

Also wanted to mention - 1.0 is nearly ready for release! The code has been drastically simplified with more modern tooling, take a look here: https://github.com/jiaweihli/monapt/tree/1.0

Adding fantasy-land support would be right after, in 1.1.