JSMonk / sweet-monads

The library which provides useful monads, interfaces, and lazy iterators.
MIT License
318 stars 20 forks source link

Add compatibility with Fantasy Land #69

Open jceb opened 10 months ago

jceb commented 10 months ago

It would be great if the implementation would be compatible with Fantasy Land: https://github.com/fantasyland/fantasy-land

JSMonk commented 10 months ago

Yes, it sounds great. I will try to investigate it. Could you also share your opinion on what should be added or changed to be more compatible?

jceb commented 10 months ago

There's actually not too much. Fantasy Land specifies type classes and methods that are available on these type classes. Your implementation can integrate these methods and it'll be automatically compatible with other Fantasy Land implementations like Sanctuary.js. Here's Sanctuary's type class implementation: https://github.com/sanctuary-js/sanctuary-type-classes

Another example is Fluture that offers an alternative to Promises and is also compatible with Fantasy Land.