-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lack of fantasy-land compatibility #421
Comments
Hey @krzysztofpniak thanks for reaching out! I don't currently see fantasy-land mentioned in this repository's readme. Correct me if I'm wrong, but do you mean the README for cujojs/most? As for |
hi @krzysztofpniak, thanks for the comment, check out #239 where the discussion for adding fantasy was originally requested. So its probably because you thought of https://github.com/cujojs/most#interoperability which is the original mostjs. let us know your thoughts |
Hi, you are right, thanks for clarification. The Readme from cujojs/most caused my assumption that @most/core also implements it. Anyways, I think @most/core should implement fantasy-land because at the moment it is still more popular than static land. Currently both ramda and sanctuary have only fantasy-land support. This holds me from using @most/core, because I see it as an addition to the basic operations library that ramda or sanctuary provides. Don't get me wrong, I still think static land is simpler and better approach but in my opinion it is too soon to use it without fantasy-land backup. |
@krzysztofpniak, in the mean time something like this might work for you - https://codesandbox.io/s/practical-ganguly-8jc13 |
@TylorS Thanks |
Coming from BaconJS (which assembles everything in a huge In my code I'd like @krzysztofpniak 's example of using ramda's However I think creating a FantasyLand Stream type might be the wrong way. As already stated by @briancavalier in #239:
Another way would be to patch ramda's FL functions to dispatch to mostjs, as I've attempted for Promises. With that you can import {chain, map, lift} from 'ramda';
chain(x => Promise.resolve(x + 3), Promise.resolve(2)) // ~> Promise 5
map(x => x + 3)(Promise.resolve(2)) // ~> Promise 5
const concat = lift((a, b) => a + b);
concat(Promise.resolve("A"), Promise.resolve("B")) // ~> Promise "AB" Should be a no-brainer to do the same for mostjs and even straight-forward to do it for baconjs. It should be the right place for the adapter too, since ramda switches implementations depending on the data type. Also such a general adapter layer was already mentioned in a ramda discussion. Since that did not get much traction, sadly I have to tend my own fork of ramda. 😢 |
Closing in favor of #239 |
What about the FL laws?
@TylorS Its a nice code snippet. I mean
is clearly not the case for @most/core, because I don't know what implication this has, if one just employs a FL compatible utility library like Ramda. |
Readme says that it is compatible with fantasy-land while it is not. Simple proof:
https://codesandbox.io/s/stupefied-kapitsa-s48mp
The text was updated successfully, but these errors were encountered: