Closed OliverJAsh closed 7 years ago
Updated base to S_0.12
branch.
Sorry it took that long, but sadly I don't think I will be maintaining this typings anymore :confused:. (At work we are using a "methods" form, but that is being removed in new Sanctuary version. Function composition has issues with TypeScript [one has to manually specify a lot more types - inference is often not working], so using methods is, at this time, a much better choice. For now we are staying on the old version, but we will probably switch to something else [maybe I'll write something, we are not using that many things from Sanctuary], because only unique thing Sanctuary offers - dynamic type checking - is broken at that version).
@mnn, it would be quite easy to write a Sanctuary wrapper which modifies prototypes to support method chaining. For example:
const S = require('sanctuary');
S.Maybe.prototype.map = S.Maybe.prototype['fantasy-land/map'];
...
module.exports = S;
You should check out fp-ts https://github.com/gcanti/fp-ts
Without describing how the generic F is used in the interface, there's no way for TypeScript to perform inference when a functor is provided.
Example: