

// futurize :: Constructor -> CPS -> ( ...args -> Future )
export const futurize = Future => fn => function (...args) {
  return new Future((rej, res) =>
    fn(...args, (err, result) => err? rej(err): res(result))
  );
};


// futurizeP :: Constructor -> Promise -> ( ...args -> Future )
export const futurizeP = Future => fn => function (...args) {
  return new Future((rej, res) =>
    fn(...args).then(res, rej)
  );
};



// futurize :: Constructor -> CPS -> ( ...args -> Future )
export const futurize = Future => fn => function (...args) {
  return new Future((rej, res) =>
    void fn(...args, (err, result) => err? rej(err): res(result))
  );
};


// futurizeP :: Constructor -> Promise -> ( ...args -> Future )
export const futurizeP = Future => fn => function (...args) {
  return new Future((rej, res) =>
    void fn(...args).then(res, rej)
  );
};

Stop returning values from the computation
Stop returning values from the computation

Fixes #43