Allow ReaderT to work with Fluture
Is your feature request related to a problem? Please describe. It would be nice to be able to use the Fluture async library to work with the ReaderT monad.
Describe the solution you'd like Seamless use the Fluture type.
Describe alternatives for how you do this now
I'm using the Async type.
Code
const C = require('crocks');
const Future = require('fluture');
const {ReaderT} = C;
const ReaderFuture = ReaderT(Future)
ReaderFuture.ask()
.runWith()
.fork(e => e, x => x);
This currently results in the following exception:
/Users/svozza/git/github.com/svozza/crocks-test/node_modules/crocks/Reader/ReaderT.js:23
function () { return (_type + "( " + (Monad.type()) + " )"); }
^
TypeError: Monad.type is not a function
at type (/Users/svozza/git/github.com/svozza/crocks-test/node_modules/crocks/Reader/ReaderT.js:23:49)
at ReaderT (/Users/svozza/git/github.com/svozza/crocks-test/node_modules/crocks/Reader/ReaderT.js:71:29)
at Function.ask (/Users/svozza/git/github.com/svozza/crocks-test/node_modules/crocks/Reader/ReaderT.js:33:14)
at Object.<anonymous> (/Users/svozza/git/github.com/svozza/crocks-test/fluture.js:7:14)
at Module._compile (internal/modules/cjs/loader.js:1085:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:791:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
Just as an initial thought, could you write something in your local codebase that modifies the prototype of Future or you could wrap it if you wanted?
Sure, but the whole point of the Fantasyland spec was to make all these types interoperable.
Sorry it's my bad, I hadn't seen the conversation on gitter so didn't have the context. The above comment was not to say that it won't be done but more to help you get through your immediate need why you waited for the change to be committed
Ah sorry, I phrased that a bit blunter than I should have! I get what ya mean.